RAND in Excel: Random Numbers, Bounds and Recalculation
Use Excel RAND for random decimals, bounded values, integer draws and scenario assignments. Understand recalculation, freezing values and property-based checks.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: RAND() returns a uniformly distributed random real number greater than or equal to 0 and strictly less than 1. It takes no arguments and recalculates when the worksheet calculates. The correct expected result is a range of possible values, not one particular decimal.
Syntax and basic example
=RAND()
There is no seed, minimum or maximum argument. =RAND(10) is not a supported way to seed the generator or request ten values. Microsoft’s RAND reference documents the interval 0 ≤ result < 1 and the recalculation behavior.
- Put
Random valuein A1. - Put
=RAND()in A2. - Format A2 as a Number with several decimal places.
- In B2, enter
=AND(A2>=0,A2<1).
B2 is expected to return TRUE. The exact value in A2 varies, so no sample draw is supplied here. Testing the reference A2 checks one stored result; writing new RAND calls in a check creates additional draws rather than inspecting that cell’s draw.
Display rounding can make a value just below 1 appear as 1.00. The stored-value comparison is more useful than judging only the formatted display. Repeated or similar displayed values do not by themselves show that recalculation failed.
Worked example: a random value from 20 to below 25
=20+RAND()*5
Expected property: 20 ≤ result < 25. Multiplying a value in [0,1) by 5 gives a value in [0,5); adding 20 shifts it to [20,25).
For configurable bounds, put 20 in D2 and 25 in E2, then use:
=$D$2+RAND()*($E$2-$D$2)
Copy down to create multiple random values. The dollar signs retain the same bound cells. This recipe assumes lower bound D2 is less than upper bound E2. Equal bounds produce a constant; reversed bounds do not preserve the stated lower-inclusive, upper-exclusive interpretation. Validate the bound inputs instead of relying on accidental ordering.
Integer example: six equal-width outcomes
=INT(RAND()*6)+1
Expected result: one of 1, 2, 3, 4, 5 or 6. Multiplication creates a value in [0,6); INT assigns it to 0–5; adding 1 shifts the outcomes to 1–6. The six equal-width intervals correspond to equal probabilities under RAND’s documented uniform model.
More generally, for integer lower bound a and upper bound b, with a ≤ b, use a+INT(RAND()*(b-a+1)) to include both integer endpoints. Keep the bounds integral. RANDBETWEEN is the dedicated alternative for integer-bound tasks.
Do not use ROUND(RAND()*5,0)+1 as an equivalent six-outcome formula: the two endpoint rounding regions are only half as wide as the interior regions. Small sets of draws also need not contain equal counts of each outcome, even with the equal-width INT construction.
Advanced example: assign a 30% scenario using one draw
Suppose each row should be assigned either Review with probability 30% or Standard otherwise. Put =RAND() in A2 and use:
=IF(A2<30%,"Review","Standard")
Copy both formulas down for the records. The interval from 0 up to, but not including, 0.3 has width 0.3, so the model assigns a 30% chance to Review. A small sample is not guaranteed to contain exactly 30% Review rows. If you need an exact quota, this independent threshold recipe does not satisfy that requirement.
Keep one random helper value per record if several downstream formulas must describe the same random scenario. Separate RAND calls can produce different values. RAND does not guarantee unique identifiers, reproducible sequences or a particular balance in a finite sample, and its documentation gives no cryptographic security guarantee. Do not use it to generate secrets or permanent identity keys.
For multiple random values in a dynamic array, consult RANDARRAY and that function’s separate availability and argument rules.
Recalculation and retaining a result
RAND is volatile: when the worksheet recalculates, its formulas are evaluated again. Under automatic calculation, editing data or formulas elsewhere can trigger recalculation. Calculation settings affect when this occurs, so a displayed value may persist until the next calculation. A new evaluation need not look different at the displayed precision.
Microsoft documents a specific way to keep one value: enter =RAND() while editing in the formula bar, then press F9 to evaluate it into a value. This replaces the formula, so the cell no longer generates a new random result. This documented editing shortcut is distinct from pressing F9 outside formula editing, which recalculates the worksheet. Keyboard behavior can differ by platform and configuration; verify it in your Excel environment before applying it to important work.
For an audit or a scenario you must reproduce later, retain the realized values and the inputs as a snapshot. RAND has no seed parameter that lets this worksheet formula replay a previous sequence. Do not freeze a formula unintentionally while expecting it to keep updating.
Troubleshooting and checks
- Values change unexpectedly: Look for recalculation, including edits elsewhere in an automatically calculated workbook. Keep a value rather than a RAND formula when a fixed result is required.
- Values appear unchanged: Check calculation settings and displayed precision before concluding that RAND is not working.
- A formatted result seems out of bounds: Compare the stored value with the bounds; rounding can hide the strict upper limit.
- An integer result is outside the intended set: Recheck the multiplier and final offset, and distinguish inclusive integer bounds from the half-open decimal interval.
- A short run looks uneven: Uniform distribution is not an exact per-sample quota. Check interval logic separately from long-run statistical behavior.
The checked Microsoft page does not publish a RAND-specific error table. The only supported signature here is RAND() with empty parentheses. English formulas use commas; your locale may require semicolons in formulas with arguments.
Availability and verification
The current Microsoft RAND reference, checked 19 October 2026, lists Excel for Microsoft 365 on Windows and Mac, Excel 2024 and 2021 on Windows and Mac, and Excel 2019 and 2016. These are documentation applicability labels, not a statement of vendor lifecycle support. The first release containing this function is not established here. The current English page does not list Excel for the web; that omission alone does not establish that web Excel lacks the function.
The examples in this guide are independently derived expectations based on the documented contract, not recorded Excel runs. No Excel version was available for native testing, and no screenshot is presented as execution evidence. Actual random values are deliberately not supplied; validate the stated properties rather than matching a fixed decimal.