RAND returns a random decimal between 0 and 1. Scale and shift it to get a random value in any range — for simulations, sampling, jitter, and test data.
The example
Random values inside a chosen band.
| A | B | |
|---|---|---|
| 1 | Range | Random |
| 2 | 0 to 1 | 0.4271… |
| 3 | 10 to 20 | 14.83… |
The formula
The formula:
How it works
How it works:
RAND()returns a uniform random decimal ≥ 0 and < 1, recalculating on every change.- Scale to any range with
min + RAND()*(max-min). - For random integers, use
RANDBETWEEN(low, high)instead. - To freeze a random value so it stops changing, copy the cell and Paste Special → Values.
RAND is volatile — it recalculates on every edit and every press of F9, so the numbers change constantly. That’s great for resampling a simulation, but if you need a fixed sample, paste as values to lock it in.
Try it: interactive demo
Range, then roll.
Variations
Random integer
Whole numbers:
Random percentage
0–100%:
Random from list
Pick a row:
Pitfalls & errors
Volatile. RAND recalculates constantly; paste as values to freeze a sample.
Upper bound excluded. RAND() never returns exactly 1, so max is approached but not hit.
Not cryptographic. RAND is fine for modeling, not for security or true randomness.
Practice workbook
Frequently asked questions
How do I generate a random decimal in a range in Excel?
How do I get a random whole number?
How do I stop random numbers from changing?
Stop fighting formulas. Learn them in a day.
This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class