RAND function

RAND returns a random decimal number between 0 and 1, useful for generating random samples, simulations, and unpredictable variations in forecasts.

=RAND()

Generate a RAND formula

Describe what you need. The generator will reach for RAND where RAND is the right tool, and tell you when it is not.

How to get a better answer
  • Name your columns by letter and by header: "column F (Net Value)" beats "the amount column".
  • State every condition, including the negatives — "not cancelled" changes the formula's shape.
  • Say where the data starts if it is not row 1, and whether it will grow.
  • Check the settings above match your spreadsheet: the wrong argument separator is a syntax error on your machine.

Arguments

ArgumentRequiredDescription

Returns

A decimal number between 0 (inclusive) and 1 (exclusive), changing each time the sheet recalculates.

Availability

Excel: All · Google Sheets: Supported

Worked examples

1. Randomly order customers for weekly outreach

CustomerPlanMRRSignupDateChurnDateRandom
AlicePro992025-01-150.847
BobStarter192024-06-012025-06-150.312
CarolEnterprise4992025-03-010.659
DavePro992024-11-010.421
EveStarter192025-08-010.891
=RAND()  — placed in column F ("Random") for each customer

Result: Column F shows random decimals; sort the entire table by this column to shuffle customer order.

RAND() assigns each customer a unique random value. After sorting by column F, the outreach list becomes Alice → Carol → Dave → Bob → Eve, or any other randomized order. This ensures fair rotation through your customer base week to week without bias.

2. Simulate next month's MRR with random variance

CustomerPlanMRRSignupDateChurnDateForecasted MRR
AlicePro992025-01-15102.14
BobStarter192024-06-012025-06-1518.76
CarolEnterprise4992025-03-01507.34
DavePro992024-11-0196.88
EveStarter192025-08-0119.43
=MRR * (1 + (RAND() - 0.5) * 0.1)  — in column G ("Forecasted MRR")

Result: Each customer's MRR forecast includes ±5% random variance, simulating realistic month-to-month fluctuation.

The formula subtracts 0.5 from RAND() to shift the range to ±0.5, multiplies by 0.1 for ±5% variance, then applies it to current MRR. Alice's forecasted 102.14 reflects her base 99 plus a 3.14 random swing. Run recalculations to see different outcomes; average these across many iterations for a Monte Carlo revenue forecast.

3. Determine which customers churn in a simulation

CustomerPlanMRRSignupDateChurnDateSimulated Outcome
AlicePro992025-01-15RETAIN
BobStarter192024-06-012025-06-15CHURN
CarolEnterprise4992025-03-01RETAIN
DavePro992024-11-01RETAIN
EveStarter192025-08-01RETAIN
=IF(RAND() < 0.08, "CHURN", "RETAIN")  — in column H ("Simulated Outcome")

Result: Customers with RAND() < 0.08 are marked CHURN; all others RETAIN. Press F9 to recalculate and run another round.

This simulates a monthly churn rate of 8% by comparing a random number to your threshold. Eve and Dave retain; Bob churns (his RAND value was below 0.08). Copy this formula to thousands of rows and count the CHURN results to validate your retention assumptions and forecast revenue impact across many scenarios.

Common errors

Which RAND error are you seeing?
RAND returned an error#NAME?
Verify spelling is exactly =RAND() with no arguments. In Google Sheets, use =RAND(). In Excel, ensure Analysis Toolpak is installed if using an old version.
#VALUE!
Remove all arguments. Use =RAND() alone to get a value 0–1, then scale it with arithmetic: =RAND()*100 for 0–100, or =INT(RAND()*10) for integers 0–9.
#NUM!
Break circular references by moving RAND formulas to a separate column or helper sheet. If the error persists, copy the RAND results and paste as values to stabilize the calculation.
ErrorWhy it happensHow to fix it
#NAME?Function name misspelled, e.g., =RAN() or =RANDOM() instead of =RAND(). In older systems or some regional settings, RAND may not be available.Verify spelling is exactly =RAND() with no arguments. In Google Sheets, use =RAND(). In Excel, ensure Analysis Toolpak is installed if using an old version.
#VALUE!Passing arguments when RAND takes none, e.g., =RAND(100) or =RAND(1,10). Excel and Sheets differ slightly in how they handle unexpected arguments.Remove all arguments. Use =RAND() alone to get a value 0–1, then scale it with arithmetic: =RAND()*100 for 0–100, or =INT(RAND()*10) for integers 0–9.
#NUM!Rarely, a spreadsheet engine exception if RAND is called in an unstable circular reference or during forced recalculation under memory constraints.Break circular references by moving RAND formulas to a separate column or helper sheet. If the error persists, copy the RAND results and paste as values to stabilize the calculation.

Tips and when to use something else

  • RAND recalculates every time your sheet changes—use Paste Special > Values to lock in random numbers if you need them to stay constant.
  • To generate random integers in a range, combine RAND with INT or RANDBETWEEN: use =INT(RAND()*(max-min+1))+min for integers between min and max.
  • For weighted random selection (e.g., 80% retention, 20% churn), compare RAND() to your probability threshold: =IF(RAND()<0.2, "CHURN", "RETAIN").
  • If you need reproducible randomness for testing, use INDEX and MATCH with a seed value instead of RAND, or freeze RAND results as values immediately after generating them.

Frequently asked questions

Why do my random numbers change every time I open the spreadsheet?
RAND is a volatile function—it recalculates whenever the sheet recalculates (every edit, refresh, or file open). To lock in values, select the RAND cells, copy, then paste as values using Paste Special.
How do I get random whole numbers instead of decimals?
Wrap RAND in INT to truncate decimals, then scale: =INT(RAND()*10) gives random integers 0–9. For a custom range like 1–50, use =INT(RAND()*50)+1.
Can I use RAND to randomly pick a name from a list?
Yes. Combine RAND with INDEX: =INDEX(A1:A100, INT(RAND()*ROWS(A1:A100))+1) randomly selects one cell from the range. Or use INDEX with RANDBETWEEN if available in your spreadsheet.
When should I use RAND instead of a different function?
Use RAND for true random sampling, Monte Carlo simulations, and random ordering. For choosing from weighted categories, use IF with RAND to compare thresholds. If you need random integers only, RANDBETWEEN is simpler. For reproducible sequences (e.g., testing), avoid RAND and hard-code values instead.

Need a different formula?

The full generator is not scoped to one function — describe any spreadsheet problem and it will pick.

Open the formula generator

Reviewed 2026-09-17