RANDBETWEEN Function – Google Sheets

The RANDBETWEEN function is used in Google Sheets to generate a random integer between two whole numbers.

To produce a random decimal, consider using the RAND. Get your copy of these examples in a live Google Sheet.

Purpose

This function returns a random integer between two specified amounts.

Syntax

=RANDBETWEEN(low, high)

  • low – The lowest possible number of the random range
  • high – The highest possible number of the random range

Similar Functions

RAND – Generates a random decimal

RANDARRAY – Generates an array of random numbers

Insert Math Symbols (Add-On)

Web banner showing math symbols from the Insert Special Characters Add-On
Explain Your Formulas with Symbols

Example Use of the RANDBETWEEN Function

The RANDBETWEEN function requires two inputs.

The RANDBETWEEN function producing a random integer
RANDBETWEEN Function

Typing =RANDBETWEEN(3,87) into a cell returns a random integer between 3 and 87. In this case, the number is 18.

Live Examples in Sheets

Go to this spreadsheet for examples, along with RAND and RANDARRAY that you can study and use anywhere you want.

Notes

  • The output of RANDBETWEEN changes whenever the spreadsheet changes or reloads (like TODAY, NOW, RANDARRAY, and RAND).
    • If you want the output to be static, consider using Copy and then Paste special as a value.
  • Avoid using too many RANDBETWEEN functions in your spreadsheet, as it can slow it down with the extra recalculations.
  • To force the random number to be recalculated more frequently, go to the File -> Settings -> Calculations, then change the setting from On change to On change and every minute or On change and every hour.

Video Tutorial

Leave a Comment