Contact

RANDBETWEEN in Collabora Office: Generate Inclusive Random Integers

Mathematical Intermediate Collabora Office Calc

Use Collabora RANDBETWEEN with inclusive integer bounds, test range properties, map draws to categories, and preserve values before recalculation.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: =RANDBETWEEN(20;30) returns an integer from 20 through 30, including both endpoints. The exact draw is unpredictable, and it can change whenever Calc recalculates.

Syntax and recalculation

=RANDBETWEEN(Bottom; Top)

Bottom and Top are required integer bounds. Both endpoints are included. The range 20–30 therefore contains 11 possible integer values, not ten.

The Collabora section says this function is always recalculated whenever a recalculation occurs, and gives F9 as a way to force recalculation manually. A recalculation does not guarantee a visibly different result; the same integer can be drawn again.

The dedicated help does not specify fractional-bound rounding or every invalid-bound error. Use integer Bottom and Top with Bottom no greater than Top instead of assuming another spreadsheet’s coercion rules.

Example: make a bounded integer list

Put 20 in F1 and 30 in G1. Enter this in A2 and fill down through A11:

=RANDBETWEEN($F$1;$G$1)

Every valid result should be an integer within the inclusive bounds. There is no single expected ten-row sequence. For deterministic checks of a reported value in A2, use:

=AND(A2>=$F$1;A2<=$G$1;A2=INT(A2))

The expected check result is TRUE for any valid draw. INT checks the integer property in this positive range; AND combines the three conditions.

These checks describe mathematical invariants, not a native test performed here. They cannot prove that the distribution is uniform or that separate draws are independent.

A fixed-output boundary control

The inclusive single-value interval gives a useful control:

=RANDBETWEEN(7;7)

The only permitted integer is 7, so that is the independently expected result. This does not show that the function is nonvolatile; repeated recalculation can still select the same sole value.

Likewise, =RANDBETWEEN(-2;2) has the possible-value set −2, −1, 0, 1, 2 under its integer-range contract. Negative bounds do not imply that output must be negative when the interval crosses zero.

Advanced example: map one draw to a category

Put =RANDBETWEEN(1;4) in C2. In D2 use:

=CHOOSE(C2;"North";"South";"East";"West")

The mapping is deterministic: 1→North, 2→South, 3→East, 4→West. An independent control of C2=3 must produce East. CHOOSE translates the numeric position into the desired label.

Store the draw once and reference its cell. Writing two independent RANDBETWEEN calls in a label and an audit column can produce unrelated values. A repeated label is also allowed; this setup draws with replacement and does not create a unique shuffled list.

The short vendor section does not establish a distribution guarantee, so this mapping alone is not proof that each category has a precisely certified selection probability in your application.

Advanced use: inspect counts without mistaking them for guarantees

After saving a values-only copy of a sample, count a particular result with COUNTIF. If the fixed sample is 1, 3, 3, 2, 4, 3, the count of 3 is 3, and its sample fraction is 3/6=0.5.

That is a property of that supplied sample, not the population probability and not an actual generated dataset from this guide. Small samples can contain repeated or missing values even when the underlying generator is behaving as designed.

Freeze an auditable set of outputs

The vendor recommends copying the cells and using Edit → Paste Special with Numbers selected and Paste All and Formulas not selected. This stores the numbers instead of formulas that draw again. Keep a separate formula template if future draws are needed.

Verify the destination cells contain values. Merely saving the workbook does not establish that volatile formulas are frozen. For a result that must be cited or audited, retain the exact saved values and the bounds used to generate them.

Errors and limitations

Check that both bounds are integers in the intended order. The source does not document the exact native error for every invalid input, maximum supported interval, or random-generator quality. Do not infer cryptographic security or unique sampling. RAND serves a different numeric-output purpose; scaling it by hand does not automatically reproduce RANDBETWEEN’s endpoint behavior.

Availability and verification

The exact function is documented in Collabora Office 26.04 desktop help, retrieved and reviewed on October 17, 2026. This establishes a documentation scope, not the first release that introduced the function or the last version in which it works; those versions and any retirement date remain unestablished. Collabora Online and mobile support are not inferred from desktop help, nor is behavior in another spreadsheet product.

The examples are documentation-based expectations with independent calculations. They have not been executed in Collabora Office. No application screenshot or native error/coercion certification is implied. Formulas use English function names and semicolon argument separators.

References