Summary
The Excel RAND function generates a random decimal number between 0 and 1. It’s widely used in simulations, statistical sampling, probability analysis, and scenarios where random value generation is needed. Each time the worksheet recalculates, RAND returns a new random number.
Syntax
=RAND()
This function does not have any arguments.
Return value
A random decimal number between 0 and 1.
How to use
Simply use =RAND() in a cell to generate a random decimal number. Every time the worksheet recalculates, a new random number is generated.
Examples
Simple RAND
Generating a Random Decimal Number: To generate a random decimal:
=RAND()
Each time the worksheet recalculates, this formula will produce a new random decimal number between 0 and 1.
RAND with Multiples
Random Number for Simulations: Using RAND for simulations or modeling:
=RAND() * 100
This formula generates a random decimal number and multiplies it by 100, useful in scenarios where you need a random number between 0 and 100.
RAND for Data Sampling
Random Selection in Data Sampling: Selecting a random sample from a dataset:
=INDEX(Data_Range, ROUNDUP(RAND() * COUNTA(Data_Range), 0))
This formula selects a random item from a data range.
RAND in Probability Analysis
Probability Analysis with RAND: Using RAND for basic probability calculations:
=IF(RAND() < 0.5, "Heads", "Tails")
This simulates a coin toss where there’s a 50% chance of getting either Heads or Tails.
RAND for Date Generation
Creating Random Dates: Generating random dates within a specific range:
=DATE(2020, 1, 1) + RAND() * (DATE(2020, 12, 31) - DATE(2020, 1, 1))
This formula generates a random date in the year 2020.
Additional Notes
- RAND is a volatile function, meaning it recalculates and generates a new number every time a worksheet recalculates.
- It’s ideal for scenarios requiring quick and basic random number generation without specific criteria.