RAND function
Returns a random decimal number from 0 up to (but not including) 1, recalculated every time the sheet changes.
Available in All versions of Excel, Excel for the web, Excel for Mac
In every Excel versionWorks in Google Sheets
Syntax
RAND()This function takes no arguments.
Returns: A random number ≥ 0 and < 1, evenly distributed.
How RAND works
RAND produces a random number between 0 and 1. On its own that sounds abstract, but it is the basis of many practical tools: shuffling a list, picking a random winner or audit sample, generating test data, and Monte Carlo simulations where you run a model thousands of times with random inputs to see the range of outcomes.
To get a random number in another range, scale it: =min + RAND()*(max-min). For random whole numbers RANDBETWEEN is simpler, and in Microsoft 365 RANDARRAY can produce a whole block of random values at once.
RAND is volatile: it recalculates every time anything in the workbook changes or you press F9, so the values keep moving. To freeze them, copy and Paste Special > Values. The numbers are pseudo-random, good for simulations and sampling but not for cryptography or security.
Examples
1A random number between 0 and 1
| A | |
|---|---|
| 1 | 0.7351 |
Result: 0.7351
Shown with 4 decimals. Because the function recalculates whenever the sheet changes, your result will differ; the value shown is only an illustration.
2Random price between 50 and 100
| A | |
|---|---|
| 1 | 81.27 |
Result: 81.27
RAND × 50 gives 0 to 50; adding 50 shifts the range to 50–100 (2 decimals). Because the function recalculates whenever the sheet changes, your result will differ; the value shown is only an illustration.
3Pick a random employee
| A | B | C | |
|---|---|---|---|
| 1 | Employee | ||
| 2 | Ana | Chloe | |
| 3 | Ben | ||
| 4 | Chloe | ||
| 5 | Dev | ||
| 6 | Ema |
Result: Chloe
INT(RAND()*5)+1 is a random whole number 1–5, and INDEX returns that position from the list. Because the function recalculates whenever the sheet changes, your result will differ; the value shown is only an illustration.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
Values keep changing | RAND is volatile and recalculates after every edit. | Copy the cells and Paste Special > Values to keep a result; or set calculation to Manual. |
Tips
- Shuffle a list: put
=RAND()in a helper column next to it, then sort by that column. - Normal-distributed random value:
=NORM.INV(RAND(), mean, sd). - Press F9 to generate a new set of values.
- Many RAND cells slow down large workbooks because they recalculate constantly.
Questions
How do I stop RAND from changing?
Copy the cells and use Paste Special > Values. For a single cell, type =RAND() in the formula bar and press F9 before Enter to store the number.
Can RAND return exactly 1?
No. It returns values from 0 up to, but not including, 1.
Google Sheets
RAND also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.
RAND in other languages
In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.
| Language | Function name |
|---|---|
| Czech | NÁHČÍSLO |
| Danish | SLUMP |
| Dutch | ASELECT |
| Finnish | SATUNNAISLUKU |
| French | ALEA |
| German | ZUFALLSZAHL |
| Hungarian | VÉL |
| Italian | CASUALE |
| Norwegian (Bokmål) | TILFELDIG |
| Polish | LOS |
| Portuguese (Brazil) | ALEATÓRIO |
| Portuguese (Portugal) | ALEATÓRIO |
| Russian | СЛЧИС |
| Spanish | ALEATORIO |
| Swedish | SLUMP |
| Turkish | S_SAYI_ÜRET |