Documentation/Calc Functions/RAND

From The Document Foundation Wiki
Jump to: navigation, search
Other languages:
English

Function name:

RAND

Category:

Mathematical

Summary:

Returns a random number between 0 and 1.

Syntax:

RAND()

Returns:

This function produces a new random number each time Calc recalculates. To force Calc to recalculate manually press F9.

Arguments:

None.

Additional details:

To generate random numbers which never recalculate, either:

  • Copy cells each containing =RAND(), and use Edit - Paste Special (with Paste All and Formulas not marked and Numbers marked).
  • Use the Fill Cell command with random numbers (Sheet - Fill Cells - Fill Random Numbers).
  • Use the RAND.NV() function for non-volatile random numbers.

Examples:

Formula Description Returns
=RAND() a random number between 0 and 1 0.80206289793007
=RAND() a random number between 0 and 1 0.505532468097248

Related LibreOffice functions:

RANDBETWEEN

ODF standard:

Section 6.16.50, part2

Equivalent Excel functions:

RAND