RANDBETWEEN function

RANDBETWEEN(minimumValue, maximumValue) RANDBETWEEN(minimumValue; maximumValue)

minimumValue

Number or { Number }

The smallest integer returned by the function.

maximumValue

Number or { Number }

The largest integer returned by the function.

Returns

Number or { Number }

A random integer.

Returns a random integer (whole number) between two given numbers. Use RAND instead to return a decimal number (with a fractional part).

Examples

RANDBETWEEN(5, 15)RANDBETWEEN(5; 15)

Returns a random integer (whole number) between 5 (inclusive) and 15 (inclusive).

RAND() * 10 + 5RAND() * 10 + 5

Returns a random decimal number between 5 (inclusive) and 15 (exclusive).