RANDBETWEEN.NV Function (LibreOffice Calc)
Use LibreOffice RANDBETWEEN.NV for inclusive integer choices, calculate the outcome count, and understand which changes can regenerate a non-volatile result.
Verification status: 7 source-derived formula interpretations were checked against LibreOffice 26.8 Help, 26.8.1.1 registration and the complete callback. No random samples or recalculation events were executed. How formula examples are checked
Quick answer: RANDBETWEEN.NV(20;30) chooses an integer from 20 through 30, including both endpoints. Non-volatile results can still change after reopening, hard recalculation or a change to their bounds.
Availability and version history
- Introduced: LibreOffice 7.0, explicitly stated in the function-specific Help section.
- Supported in: 26.8 Help and 26.8.1.1 native registration; no retirement is established.
- Scope: Desktop Calc, English formulas. The documented
ORG.LIBREOFFICE.RANDBETWEEN.NVname is outside OpenFormula 1.3. - Checked: October 14, 2026. Function-specific documentation, source and example constraints were checked. Random sampling and recalculation events were not executed.
What RANDBETWEEN.NV does
RANDBETWEEN.NV is useful for random integer labels, small simulated choices and randomized practice inputs. The two limits describe the available numbers, not a count and an offset. A draw does not remove its outcome from future draws, so duplicates are allowed.
The native English name has its own opcode and a registered namespace. The inspected dispatcher invokes the integer random callback. This identity evidence is separate from the volatile RANDBETWEEN add-in function, even though both can describe the same small integer interval. Function Help.
Syntax and arguments
RANDBETWEEN.NV(Bottom; Top)
Both arguments are required. Bottom is the smallest permitted integer and Top is the largest. Use ordered integer limits for the examples. The implementation has a fractional-bound normalization step, but no fractional-limit behavior is asserted here. The inspected callback rejects reversed normalized bounds.
Source-derived examples
The table gives documented or code-derived interpretations, not recorded application results. Random rows deliberately give ranges or sets rather than invented sampled numbers.
| Formula | Source-derived result or constraint | Setup and interpretation |
|---|---|---|
=RANDBETWEEN.NV(20;30) |
One of 20, 21, …, 30 | There are 11 eligible integers. |
=RANDBETWEEN.NV(1;6) |
One of 1, 2, 3, 4, 5, 6 | A six-outcome integer example. |
=RANDBETWEEN.NV(-2;2) |
One of −2, −1, 0, 1, 2 | Both endpoints and zero are included. |
=RANDBETWEEN.NV(5;5) |
5 | The single allowed integer is a deterministic source-derived result. |
=RANDBETWEEN.NV(A1;A2) |
One of 10, 11, 12 | Assume A1=10 and A2=12. |
=2*RANDBETWEEN.NV(0;4) |
One of 0, 2, 4, 6, 8 | Scale integer indices to evenly spaced values. |
=RANDBETWEEN.NV(1;100)<=15 |
TRUE or FALSE | The predicate accepts 15 of the 100 integer outcomes. |
Practical worksheet
Set A1 to 20 and A2 to 30, then enter =RANDBETWEEN.NV(A1;A2) in B1. A separate check, =AND(B1>=A1;B1<=A2;B1=INT(B1)), should be TRUE for a valid result in these small ordered integer bounds. This verifies range and integrality of one result; it does not test distribution quality.
If you need several calculations to refer to the same choice, refer to B1 instead of repeating the random function. If you need a fixed assignment list, preserve the resulting values. Neither this function nor repeatedly filling it down guarantees unique IDs.
Advanced interpretation and checks
For integer limits a and b with a ≤ b, there are b−a+1 possible outcomes. The interval 20 through 30 has 11 outcomes, not 10. Under the intended uniform integer model, a single specified outcome has probability 1/11. For 1 through 100, the test “at most 15” accepts exactly 15 outcomes.
To obtain five evenly spaced choices 0,2,4,6,8, first draw an integer index from 0 through 4 and multiply it by 2. This differs from rounding a continuous draw: rounding would give the extreme categories narrower source intervals. The checks above concern small exactly representable integers; they do not certify behavior near floating-point integer limits. Inspected implementation.
Boundaries and troubleshooting
Official Help says unrelated new input and ordinary F9 do not regenerate the result. Reopening the file, hard recalculation, F9 with the cursor on the function’s cell, and recalculation of Bottom or Top can regenerate it. Changing A1 in the worksheet above is therefore not a way to preserve the old choice.
Validate limits before drawing and use explicit integer bounds. No native draw, fractional-bound case, large-integer limit or GUI recalculation event was executed for this guide. Equality of the bounds is supported by the inspected small-integer construction; it should not be generalized to an arbitrary huge floating-point value.
Related functions
Official evidence and checking scope
- Function-specific Help
- Complete versioned callback
- English native-name registration
- Exact random-function opcode dispatch
- Shared scalar and matrix random helper
The review covers the retained documentation and exact 26.8.1.1 source. No application run is claimed for this guide. The event rules are documentary evidence rather than measured recalculation behavior.