RAND Function

Excel 2007+

Summary

The RAND function generates a random decimal number between 0 (inclusive) and 1 (exclusive). Each time the worksheet recalculates, RAND produces a fresh random value, making it perfect for simulations, sampling, and randomized data generation.

Syntax

RAND()

Using the RAND Function

RAND is essential for creating random datasets, statistical simulations, Monte Carlo analysis, and randomized testing scenarios. Use it standalone for basic randomization or combine with other functions to generate numbers within custom ranges.

Common RAND Examples

Basic Random Number

=RAND()

Generates a random decimal between 0 and 1. Result changes every time the sheet recalculates.

Random Number in Range (0-100)

=RAND()*100

Creates random decimal between 0 and 100. Multiply by range width to scale.

Random Integer (0-99)

=INT(RAND()*100)

Generates random whole number from 0 to 99 using INT wrapper.

Random Percentage

=RAND()*100&"%"

Displays random percentage value as text for reports.

Frequently Asked Questions

RAND recalculates every time the worksheet changes (new data, F9, etc.). This is normal behavior for dynamic randomization.

Select the cell with =RAND(), press F9 to recalculate, then press Enter. This converts the formula to its current static value.

RAND returns decimals between 0-1. RANDBETWEEN returns integers within specified range.

Common Errors and Solutions

Unexpected value stability

Cause: Volatile function behavior not understood

Solution: Understand RAND recalculates on every sheet change. Use F9 to freeze values.

Wrong number range

Cause: Not scaling properly for desired range

Solution: Use formula: RAND()*(max-min)+min for custom ranges.

Notes

  • Generates uniformly distributed random numbers
  • Recalculates on: F9, Enter in other cells, opening workbook
  • To create random number between a and b: =RAND()*(b-a)+a
  • Press F9 in formula bar to convert to static value
  • Uses Mersenne Twister algorithm for quality randomness

Compatibility

Available in: Excel 2007, Excel 2010, Excel 2013, Excel 2016, Excel 2019, Excel 2021, Microsoft 365, Excel for Mac, Excel Online

Not available in: Excel 2003 and earlier

Content last reviewed: December 9, 2025
Update frequency: As needed
Excel versions tested: Excel 2007+