Math & Trig
RAND Function in Excel
Returns a random decimal number between 0 and 1.
Syntax
- =RAND()
Examples
- =RAND() - Random decimal 0-1 - Result: 0.xxxxx
- =RAND()*100 - Random number 0-100 - Result: Random value
Excel RAND function documentation
- RAND returns a random decimal greater than or equal to 0 and less than 1.
- Syntax: =RAND(). No arguments. Volatile — recalculates on every worksheet change.
- Use for simulations, random samples, lottery draws, and shuffling with helper columns.
- Related: [RANDBETWEEN](/functions/randbetween/), [RANDARRAY](/functions/randarray/), [SORT](/functions/sort/).
RAND syntax and volatile behavior
- Each recalculation produces new values — freeze with Paste Special → Values.
- Scale to range: =RAND()*(max-min)+min for continuous random between bounds.
- Never use RAND alone for cryptographic security — not cryptographically random.
- Many RAND cells slow huge models — limit count or switch to RANDARRAY block.
Step-by-step: random 10% audit sample
- Step 1 — Data rows 2:1000.
- Step 2 — Helper column: =RAND() copied down.
- Step 3 — Filter rows where helper <= 0.1 for ~10% sample.
- Step 4 — Paste values on helper before sharing workbook.
- Step 5 — For integer IDs use [RANDBETWEEN](/functions/randbetween/) instead.
RAND vs RANDBETWEEN vs RANDARRAY
- RAND — decimal 0–1; scale manually.
- RANDBETWEEN — integer inclusive range.
- RANDARRAY — spill grid of random values in Microsoft 365.
- Shuffle list: helper RAND + Sort ascending on helper.
Worked examples to copy
- Random percent: =RAND().
- 0–100 score: =RAND()*100.
- Random yes/no: =IF(RAND()>0.5,"Yes","No").
- Unique random order: =RAND() then Data → Sort.
People also ask
- Stop RAND from changing? — Copy → Paste Special → Values.
- RAND integer 1–6? — Use =RANDBETWEEN(1,6).
- RAND same seed? — Excel has no built-in seed; use RANDARRAY or VBA for reproducible runs.
- RAND slow workbook? — Volatile; replace with static values after generation.
Common errors
- Recalculates on every worksheet change
Use cases
- Random sampling
- Simulations
- Test data generation
Frequently asked questions
- How do I generate a random number that doesn't change? RAND recalculates on every change. To freeze random values: 1) Select cells with RAND formulas, 2) Copy (Ctrl+C), 3) Paste Special > Values (Ctrl+Shift+V). This replaces formulas with static numbers.
- How do I generate random numbers in a specific range? Use =RAND()*(max-min)+min. For random between 50 and 100: =RAND()*50+50. For integers, wrap in INT or ROUND: =INT(RAND()*51+50). Or use RANDBETWEEN(50,100) for integers directly.
- Is RAND truly random? RAND uses a pseudorandom number generator - it's statistically random enough for most purposes but not cryptographically secure. For simulations and sampling it's excellent. For security-critical applications, use external tools.
Editorial review
- Reviewed by Excel.Directory Editorial Team. Updated May 2026.
When to use RAND
- Random sampling — common Math & Trig scenario for RAND.
- Simulations — common Math & Trig scenario for RAND.
- Test data generation — common Math & Trig scenario for RAND.
RAND in the Math & Trig category
- Browse all Math & Trig functions at /categories/math-trig/ for related formulas.
- RAND syntax: =RAND()
- Confirm RAND arguments match the syntax shown above before filling down.
- Lock table and range references with $ when copying formulas across rows or sheets.
Formula checklist before you copy down
- Confirm RAND arguments match the syntax shown above before filling down.
- Lock table and range references with $ when copying formulas across rows or sheets.
- If results look wrong, check for text stored as numbers and invisible spaces with TRIM.
- Spot-check three known input rows manually against expected output.
Related Excel functions
- RANDBETWEEN (/functions/randbetween/): Returns a random integer between two specified numbers.
- RANDARRAY (/functions/randarray/): Returns an array of random numbers.
Errors to watch for
- Recalculates on every worksheet change — review causes on linked error pages in the directory.
Copy-paste audit workflow
- Enter RAND on three test rows with known expected output documented on a QA tab.
- Fill down only after absolute references are locked on lookup tables and rate tables.
- Compare against manual calculation or a calculator for financial and statistical functions.
- Search this directory for comparison guides when choosing between similar functions in the same category.
RAND worked examples to copy
- =RAND() — Random decimal 0-1. Expected result: 0.xxxxx.
- =RAND()*100 — Random number 0-100. Expected result: Random value.
RAND reference summary for crawlers and offline review
- RAND belongs to the Math & Trig category in Excel. Returns a random decimal number between 0 and 1.
- Full syntax: =RAND(). Open /functions/rand/ for parameters, FAQs, and related pages.
- Common mistakes: Recalculates on every worksheet change
- Pair this function with comparison guides when another Excel formula might fit the same task better.
- Review fix-excel-formula-errors when unexpected errors appear after upgrading Excel or sharing across locales.