Random Decimal in a Range (RAND)

Excel Formulas › Math

All versionsRAND

RAND returns a random decimal between 0 and 1. Scale and shift it to get a random value in any range — for simulations, sampling, jitter, and test data.


Quick formula: random decimal between min A2 and max B2:
=A2 + RAND() * (B2 - A2)
RAND() gives 0–1; multiply by the span and add the minimum to land anywhere in [min, max].

Functions used (tap for the full reference guide):

The example

Random values inside a chosen band.

AB
1RangeRandom
20 to 10.4271…
310 to 2014.83…

The formula

The formula:

=A2 + RAND() * (B2 - A2) // min + span × random

How it works

How it works:

  1. RAND() returns a uniform random decimal ≥ 0 and < 1, recalculating on every change.
  2. Scale to any range with min + RAND()*(max-min).
  3. For random integers, use RANDBETWEEN(low, high) instead.
  4. To freeze a random value so it stops changing, copy the cell and Paste Special → Values.

RAND is volatile — it recalculates on every edit and every press of F9, so the numbers change constantly. That’s great for resampling a simulation, but if you need a fixed sample, paste as values to lock it in.

Try it: interactive demo

Live demo

Range, then roll.

Value:

Variations

Random integer

Whole numbers:

=RANDBETWEEN(1, 100)

Random percentage

0–100%:

=RAND()

Random from list

Pick a row:

=INDEX(list, RANDBETWEEN(1, COUNTA(list)))

Pitfalls & errors

Volatile. RAND recalculates constantly; paste as values to freeze a sample.

Upper bound excluded. RAND() never returns exactly 1, so max is approached but not hit.

Not cryptographic. RAND is fine for modeling, not for security or true randomness.

Practice workbook

📊
Download the free Random Decimal in a Range (RAND) practice workbook
A RAND sheet with the integer, percentage, and pick-from-list variants, plus 4 challenges with answers. No sign-up required.

Frequently asked questions

How do I generate a random decimal in a range in Excel?
Use =A2 + RAND()*(B2-A2) where A2 is the minimum and B2 the maximum. RAND() returns 0–1, scaled to your range.
How do I get a random whole number?
Use =RANDBETWEEN(low, high), which returns a random integer inclusive of both ends.
How do I stop random numbers from changing?
RAND is volatile. Copy the cells and Paste Special → Values to freeze the result.

Stop fighting formulas. Learn them in a day.

This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related formulas: Random integer · Random without repeats · Random without repeats

Function references: RAND · RANDBETWEEN