RAND function
RAND generates a random decimal from 0 up to but not including 1, and picks a fresh one every time the sheet recalculates. It is useful for sampling, simulations and shuffling.
Example
Read it as a sentence: check that each random number is at least 0 and under 1, which gives TRUE.
A
B
C
D
1
TRUE
2
3
Syntax
RAND()
RAND takes no arguments.
Returns: A random decimal from 0 up to but not including 1.
RAND is volatile: Excel works it out again every time anything in the workbook changes.
What Excel actually returns
Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.
| Formula | Excel shows | Case |
|---|---|---|
=AND(RAND()>=0,RAND()<1) | TRUE | Between 0 and 1 |
=RAND() | 0.130375454 | Raw (volatile) |
Watch out for
- It changes on every edit; paste as values to freeze it.
- Multiply and add to scale: =RAND()*100.
Where it works
- Excel
- RAND is in every version of Excel from 2007 on.
- Google Sheets
- Same name, same behaviour for everyday use.
Part of Math and trig functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .