Google Sheets
RANDBETWEEN function in Google Sheets
Returns a uniformly random integer between two values, inclusive.
=RANDBETWEEN(low, high)RANDBETWEEN syntax and parameters
Two arguments, two required.
- lownumberRequired
The low end of the random range.
- highnumberRequired
The high end of the random range.
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 Excel
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 Google Sheets gets this done.
- ABSReturns the absolute value of a number.MathExcel
- ACOSReturns the inverse cosine of a value, in radians.MathExcel
- ACOSHReturns the inverse hyperbolic cosine of a number.MathExcel
- ACOTReturns the inverse cotangent of a value, in radians. .MathExcel
- ACOTHReturns the inverse hyperbolic cotangent of a value, in radians. Must not be between -1 and 1, inclusive..MathExcel
- ASINReturns the inverse sine of a value, in radians.MathExcel