RANDBETWEEN Function
Returns a random whole number between two numbers you choose.
Category
Math & Trig
Available in
All versions, Microsoft 365
Returns
A whole number
Overview
RANDBETWEEN picks a random integer between a bottom and top value, both included.
It's ideal for test data — order quantities, ages, scores — and for random selections.
Syntax
=RANDBETWEEN(bottom, top) Explain
Arguments
| Argument | Required? | What it does |
|---|---|---|
| bottom | Yes | The smallest number it can return. |
| top | Yes | The largest number it can return. |
Examples
Example 2 — Pick a random winner
Choose one name from A2:A40.
=INDEX(A2:A40, RANDBETWEEN(1, ROWS(A2:A40))) Explain
Common mistakes
- Recalculates constantly. Paste as values once you have the numbers you want.
Notes

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.