# Difference between revisions of "Documentation/How Tos/Calc: RAND function"

From Apache OpenOffice Wiki

< Documentation | How Tos

OOoWikiBot (Talk | contribs) m (Bot: Adding Category: Documentation) |
OOoWikiBot (Talk | contribs) m (Robot: Automated text replacement %s) |
||

Line 26: | Line 26: | ||

* [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]] | * [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]] | ||

* [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}} | * [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}} | ||

− | [[Category: Documentation]] | + | [[Category: Documentation/Reference/Calc]] |

## Revision as of 09:41, 24 November 2009

## RAND

Returns a random number between 0 and 1.

### Syntax:

**RAND()**

- This function produces a new random number each time Calc recalculates, greater than or equal to 0, and less than 1.

- To force Calc to recalculate manually press Shift+Ctrl+F9.

- To generate a random number which never recalculates, copy a cell containing
, and use Edit - Paste Special... (with Paste All and Formulas**=RAND()**__not__selected and Numbers selected).

### Example:

**RAND()**

- returns a random number between
(inclusive) and**0**(exclusive).**1**

**RAND()*(b-a) + a**

- returns a random real number between
and**a**.**b**