Excel
RANDBETWEEN function in Excel
Returns a random number between the numbers you specify
=RANDBETWEEN(bottom, top)RANDBETWEEN syntax and parameters
Two arguments, two required.
- bottomnumberRequired
The smallest integer RANDBETWEEN will return.
- topnumberRequired
The largest integer RANDBETWEEN will return.
RANDBETWEEN examples
Formulas you'll actually reuse.
A dice roll:
=RANDBETWEEN(1, 6)A random customer from the list — for a raffle or a sample:
=INDEX(A2:A50, RANDBETWEEN(1, ROWS(A2:A50)))
RANDBETWEEN in Google Sheets
Same name — your formula ports as-is.
Try RANDBETWEEN in the playground
Edit the example — nothing to install.
Preloaded with the RANDBETWEEN formula from Example 1 — change anything and watch it respond.
Loading the editor…
Related functions
More ways Excel gets this done.
- ABSReturns the absolute value of a numberMathGoogle Sheets
- ACOSReturns the arccosine of a numberMathGoogle Sheets
- ACOSHReturns the inverse hyperbolic cosine of a numberMathGoogle Sheets
- ACOTReturns the arccotangent of a numberMathGoogle Sheets
- ACOTHReturns the hyperbolic arccotangent of a numberMathGoogle Sheets
- AGGREGATEReturns an aggregate in a list or databaseMathNo Google Sheets equivalent