The Excel RAND function returns a new random decimal number greater than or equal to 0 and less than 1 every time the sheet recalculates. It takes no arguments.
Syntax
| Argument | Description | |
|---|---|---|
(none) | Optional | RAND takes no arguments — always use empty parentheses. |
How to use it
RAND returns a uniformly distributed random decimal in the range 0 ≤ x < 1. It is volatile: it recalculates a fresh value every time the workbook recalculates (any edit, or pressing F9).
Scale and shift it to land in any range. For a random decimal between a and b, use a + RAND()*(b-a):
For random whole numbers, reach for RANDBETWEEN instead, or wrap RAND in INT. To spill a whole grid of random numbers at once (Excel 365), use RANDARRAY.
Volatile: the value changes on every recalculation. To freeze a result, copy the cell and Paste Special > Values.
Try it: interactive demo
Pick a RAND example to see the formula and its result.
Practice workbook
Frequently asked questions
What range does RAND return?
Why does my RAND value keep changing?
F9. To lock a value in place, copy it and use Paste Special > Values.How do I get a random number in a custom range?
a + RAND()*(b-a). For example =10+RAND()*40 gives a random decimal between 10 and 50.How is RAND different from RANDBETWEEN?
RANDBETWEEN returns a whole number between two bounds you specify, such as =RANDBETWEEN(1,6) for a die roll.Master functions like this in one day
This page covers one function. Our Excel Formulas and Functions class covers the 30 that matter most — live, hands-on, taught by professionals in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class