Home / Blog / Random Numbers
How-to · 2026

How to Generate Random Numbers in Excel

Produce random decimals or whole numbers in a range with a single function — and the trick to freeze them so they stop changing every time the sheet recalculates.

By the Quiriz Team · Published July 24, 2026 · 3 min read

The quick answer: =RAND() for a decimal between 0 and 1, =RANDBETWEEN(1,100) for a whole number in a range. Both refresh on every recalculation — the trick to stop that is below.

Random decimal — RAND

=RAND() returns a random decimal from 0 up to (not including) 1. For a decimal in a custom range, scale it: =RAND()*(100-1)+1 gives a random decimal between 1 and 100.

Whole number in a range — RANDBETWEEN

=RANDBETWEEN(1,100) returns a random integer from 1 to 100, both ends included. Swap the numbers for any range — dice rolls are =RANDBETWEEN(1,6).

Many at once — RANDARRAY (365)

=RANDARRAY(10,1,1,100,TRUE) spills ten random whole numbers between 1 and 100 down a column. The final TRUE asks for whole numbers; drop it for decimals.

Stop them changing — freeze the values

RAND and RANDBETWEEN reroll on every edit, which is rarely what you want in a finished sheet. Select the cells, copy, then Paste Special → Values — shortcut Alt + E + S + V, then Enter — over the same cells. The formulas become fixed numbers that stay put.

🛠 Free tool: prefer not to click through menus? the free Random Number Generator produces the numbers for you — pick a range and quantity, then copy them straight into Excel as fixed values.

Analyze your Excel data with AI

Ask questions about your spreadsheet in plain English and get answers in seconds. Free to start.

Try Quiriz free →

Frequently asked questions

How do I generate a random number between two numbers?
Use RANDBETWEEN: =RANDBETWEEN(1,100) returns a random whole number from 1 to 100, both ends included. Change the arguments for any range.
How do I stop random numbers from changing?
RAND and RANDBETWEEN recalculate on every edit. To lock the values, select the cells, copy them, then Paste Special > Values over the same cells. They become fixed numbers with no formula.
How do I get a random decimal in Excel?
Use =RAND() for a decimal between 0 and 1. For a decimal in another range, multiply: =RAND()*(high-low)+low gives a random decimal between low and high.
How do I generate random numbers without duplicates?
In Excel 365, =RANDARRAY has no unique option, so generate more than you need and use UNIQUE, or use SORTBY with RANDARRAY to shuffle a fixed list and take the first N — that guarantees no repeats.