
When you want to run a draw, generate sample data for training or shuffle a list, Excel's random number functions do the job. RANDBETWEEN gives a whole number between two limits, RAND gives a decimal between 0 and 1, and RANDARRAY produces a set of random numbers with one formula. All of them change on every recalculation, so knowing how to freeze the result is important.
Comparing the functions
| Function | What it produces | Example |
|---|---|---|
| RANDBETWEEN(bottom, top) | Whole number | RANDBETWEEN(1,100) |
| RAND() | Decimal between 0 and 1 | RAND()*50 |
| RANDARRAY(rows, cols, min, max, whole) | An array of random numbers | RANDARRAY(10,1,1,6,TRUE) |
RANDARRAY is available in Microsoft 365 and Excel 2021 and later.
Example uses
- Draw: give each participant a random number and pick the smallest.
- Dice simulation: RANDBETWEEN(1,6).
- Test data: random amounts for trying out a sales table.
- Random date: use RANDBETWEEN between two dates and format the cell as a date.
- 1
Add a helper column next to the list
- 2
Put a RAND formula in each row
- 3
Copy the values and paste as values only
- 4
Sort the list by the helper column
- 5
Delete the helper column
In Microsoft 365 you can do the same in one formula with SORTBY and RANDARRAY. For sorting see our sort and filter guide.
Freezing the result
Random functions recalculate on every cell change and when you press F9. To keep a result, copy the area and paste with Paste Special, Values. For a single cell, press F9 in the formula bar and then Enter to turn the result into a fixed value.
Random picks without repeats
RANDBETWEEN can produce the same number more than once. For a pick without repeats, shuffle the list with the method above and take the first N rows. For duplicate checks see our remove duplicates guide.
Common mistakes
- Sharing without freezing the result. Values change when the file opens.
- Relying on RANDBETWEEN for picks without repeats.
- Leaving many random formulas in large tables. The file slows down.
- Not documenting the process for important draws. Record the steps for transparency.
Frequently asked questions
Is it truly random? Excel produces pseudo-random numbers; they're fine for everyday work but not for security or official draws.
How do I set the number of decimals? With the ROUND function; see our Excel rounding guide.
Summary
Excel's random number functions are handy for draws, sample data and shuffling. Don't forget to paste the result as values.
Serkan Akyürek is the founder and author of toolrota; he writes step-by-step guides on Excel, AI, the cloud, personal finance and digital security.