Documentation/Calc Functions/RAND

Function name:
RAND

Category:
Mathematical

Summary:
Generates a uniformly distributed random number in the range 0 (inclusive) to 1 (exclusive).

Syntax:
RAND

Returns:
Returns a real number in the range [0, 1).

Arguments:
None.

Additional details:

 * RAND is a volatile function that produces a new random number each time Calc recalculates. This means that Calc will update the value returned by RAND when any cell is updated by selecting or pressing F9, or on any input event.


 * Use the RAND.NV function for a non-volatile equivalent.


 * To generate random numbers that never recalculate, either:
 * Copy cells containing, and use  (with All and Formulas deselected and Numbers selected).
 * Use to fill a selected cell range with random numbers, generated in accordance with the flexible settings available through the Random Number Generator dialog.


 * To generate numbers in a range other than [0, 1), either:
 * Scale the value returned by RAND to a new range using a formula of the form  to generate a number in the range [a, b]. For example, the formula   would generate random numbers in the range [-10, 10).
 * Use the RANDBETWEEN function or its non-volatile equivalent RANDBETWEEN.NV.

Related LibreOffice functions:
RAND.NV

RANDBETWEEN

RANDBETWEEN.NV

ODF standard:
Section 6.16.50, part 2

Equivalent Excel functions:
RAND