Calc RANDBETWEEN function

The RANDBETWEEN is used to generate a random integer (a whole number) between two specified values.

Help CentreFunctions & Formulas

For a full list of available calculation functions, please read What calculation functions are supported.


Description

The RANDBETWEEN function is used to generate a random integer (a whole number) between two specified values, which can be useful in a variety of applications. When you use this function, it picks a random whole number that falls between the bottom and top values you specify. Each time the function is activated or the data is refreshed, it generates a new random number.


Syntax

RANDBETWEEN(bottom, top)


The RANDBETWEEN function syntax has the following arguments:

  • bottom: Required. The smallest integer RANDBETWEEN will return. This is the lowest number that can be generated. It's the starting point of your random range.
  • top: Required. The largest integer RANDBETWEEN will return. This is the highest number that can be generated. It sets the upper limit of your random range.

Example

FormulaDescriptionResult
=RANDBETWEEN(1,100)Random number between 1 and 100 (varies)varies
=RANDBETWEEN(-1,1)Random number between -1 and 1 (varies)varies

Errors

For a full list of formula errors, please read Formula errors.


Related functions

See it working on your own data

Everything documented here ships with the platform – try the document tools free, or go live in 7 days.