Math & Trig

RAND Formula

RAND generates a random decimal number between 0 (inclusive) and 1 (exclusive) that recalculates every time the sheet changes. Use it for simulations, random sampling, Monte Carlo analysis, or adding noise to data. Since it recalculates on every edit, use Paste Special > Values to freeze random numbers once generated.

Syntax

RAND()
ParameterDescription
Try RAND in Viztab — free, no signup

Examples

Random decimal

Formula
=RAND()
Returns a value like 0.738291... — a different random number each time the sheet recalculates.

Random between 1 and 100

Formula
=RAND()*100
Returns a random decimal between 0 and 100, like 47.2839. Use INT(RAND()*100)+1 for a whole number 1-100.

Random yes/no

Formula
=IF(RAND()>0.5, "Yes", "No")
Randomly returns 'Yes' or 'No' with roughly equal probability. Useful for random assignment in experiments.

Common Errors

#N/A

RAND takes no arguments. Passing any argument like =RAND(1) will cause an error.

Tips

Freeze random values

RAND recalculates on every sheet change. To keep specific random numbers, copy the cells and Paste Special > Values to replace formulas with static numbers.

Random sampling

Add a =RAND() column next to your data, sort by it, and take the top N rows for a random sample. Simple and effective.

Uniform distribution only

RAND gives uniform random numbers. For normal distribution, use =NORM.INV(RAND(), mean, std_dev) to transform uniform to normal.

Try RAND in Viztab

Import your data and use RAND with 370+ other formulas. No signup required.

Open Viztab

Related Formulas