# Documentation/Calc Functions/RANDBETWEEN.NV

TDF LibreOffice Document Liberation Project Community Blogs Weblate Nextcloud Redmine Ask LibreOffice Donate

## Function name:

RANDBETWEEN.NV

## Category:

Mathematical

## Summary:

Returns an non-volatile integer random number between integers Bottom and Top (both inclusive). A non-volatile function is not recalculated at new input events or pressing F9. However, the function is recalculated when pressing F9 with the cursor on the cell containing the function, when opening the file, and when Top or Bottom are recalculated.

## Syntax:

RANDBETWEEN.NV(Bottom; Top)

## Returns:

Returns an non-volatile integer random number in a specified range.

## Arguments:

**Bottom** is a integer value or a reference to the cell containing that value which is the lower bound for giving the range to get random number.

**Top** is a integer value or a reference to the cell containing that value which is the bound bound for giving the range to get random number.

- If
**Bottom**is greater than**Top**, the function returns an error value. - If both
**Bottom**and**Top**are equal then the function returns that same value. - If arguments are not integer, then they are rounded to nearest integer either above or below, i.e. they truncated to integers. For eg. 5.4 is rounded to 5, 5.6 to 6 and 5.5 to 6.

## Additional details:

None

## Examples:

Formula | Description | Returns |
---|---|---|

=RANDBETWEEN.NV(20;30) | a non-volatile random integer between 20 and 30 | 23 |

=RANDBETWEEN.NV(A1;30) where A1 has 5 | a non-volatile integer between the value of cell A1 and 30. The function is recalculated when the contents of cell A1 change | 7 |

=RANDBETWEEN.NV(20.4;30.8) | a non-volatile random integer between 20 and 31, rounding to closest integers | 27 |

## Related LibreOffice functions:

## ODF standard:

None

## Equivalent Excel functions:

None