RAND Function

Returns a random decimal between 0 and 1.

Category

Math & Trig

Available in

All versions, Microsoft 365

Returns

A number between 0 and 1

Taught hands-on in Level 4: Advanced Dynamic Arrays & Logic · Dynamic Arrays module

Overview

RAND produces a new random number from 0 up to (but not including) 1 every time the sheet recalculates.

Scale it for any range, use it to shuffle lists, or to simulate uncertain values in a model.

Syntax

=RAND() Explain

This function takes no arguments — the brackets stay empty.

Examples

Example 1 — A random percentage

Simulate a discount between 0% and 20%.

=RAND()*20% Explain

Example 2 — Shuffle a list

Put =RAND() next to each name and sort by that column — or in Microsoft 365:

=SORTBY(A2:A20, RANDARRAY(19)) Explain

Example 3 — Freeze the result

RAND changes every time anything changes. To keep a draw, copy it and Paste Special › Values.

=RAND() Explain

Common mistakes

  • It keeps changing. Pressing F9, entering data or opening the file all produce new numbers.

Notes

Kyle Stott

Author

Kyle Stott

Certified Microsoft Excel Expert

Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.