Contact

RANDARRAY Function (LibreOffice Calc)

Math Beginner LibreOffice Calc LibreOffice 24.8

Build LibreOffice RANDARRAY formulas with explicit row and column counts, optional bounds and integer mode, with source-checked shape and array-entry cautions.

Verification status: 8 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: RANDARRAY(3;2;1;6;TRUE()) describes a 3-row, 2-column array whose entries are integers from 1 through 6. The shape and permitted values are predictable; the individual random entries are not.

Availability and version history

  • Introduced: LibreOffice 24.8, 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 COM.MICROSOFT.RANDARRAY name 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 RANDARRAY does

RANDARRAY creates multiple random entries from one formula. It is not a shuffled list or a sample without replacement: different array positions may contain the same number. Rows and Columns control the result’s dimensions, while Min, Max and Integers control each generated value.

The inspected implementation returns a scalar when both dimensions are 1 and otherwise allocates a matrix. A matrix-producing function does not by itself prove that a particular GUI entry method spills, resizes or displays the full result automatically. Function Help.

Syntax and arguments

RANDARRAY([Rows [; Columns [; Min [; Max [; Integers]]]]])

Square brackets mark optional arguments; do not type them. All five arguments are optional. Defaults are Rows=1, Columns=1, Min=0, Max=1 and Integers=FALSE. TRUE requests whole numbers; FALSE requests decimal values. Preserve separators when omitting an argument before another supplied argument. Use positive integer dimensions and ordered bounds. For integer mode, the examples deliberately use integer bounds rather than relying on fractional-bound normalization.

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
=RANDARRAY() One decimal value between 0 and 1 All five defaults apply; no exact random decimal is claimed.
=RANDARRAY(3;2;1;6;TRUE()) 3 rows × 2 columns; integers 1 through 6 Six entries, with possible duplicates.
=RANDARRAY(4;1;-1;1;FALSE()) 4 rows × 1 column; decimal values between −1 and 1 Explicit continuous-value mode.
=RANDARRAY(1;4;10;20;TRUE()) 1 row × 4 columns; integers 10 through 20 A horizontal result.
=RANDARRAY(2;3;5;5;TRUE()) 2 rows × 3 columns, all entries 5 A deterministic small-integer shape check.
=RANDARRAY(2;2;;;TRUE()) 2 rows × 2 columns; entries 0 or 1 The two empty argument positions retain Min=0 and Max=1.
=ROWS(RANDARRAY(3;2;1;6;TRUE())) 3 Dimension check derived from the implementation.
=COLUMNS(RANDARRAY(3;2;1;6;TRUE())) 2 A separate dimension check; it need not reuse the preceding draw.

Practical worksheet

For a six-cell integer demonstration, use =RANDARRAY(3;2;1;6;TRUE()). Official Help instructs array-formula entry when both dimensions exceed 1. Follow the array-entry method appropriate to your Calc interface, rather than typing the display braces as ordinary formula characters. This guide has not executed that entry workflow.

Before introducing randomness, use =RANDARRAY(2;3;5;5;TRUE()) to reason about a two-by-three rectangle filled with 5. Its mathematical total is 30. Then change to varied bounds for sampling. A successful shape check still would not establish uniqueness, random-quality guarantees or recalculation timing.

Advanced interpretation and checks

The eight-entry formula RANDARRAY(4;2;0;1;TRUE()) has four rows and two columns, and each entry is either 0 or 1. Its total is therefore an integer from 0 through 8. That is a deterministic constraint; no particular total is promised. Under an ideal independent fair-bit model the expected total is 4, but this review does not statistically validate that model.

For decimal mode, the inspected code adjusts the upper endpoint with nextafter before constructing its uniform distribution. Do not import RAND.NV’s strict “less than 1” statement as an exact RANDARRAY endpoint guarantee. For the small integer examples, the code floors the generated value after adjusting the upper limit to include the requested highest integer. Inspected implementation.

Boundaries and troubleshooting

The callback rejects nonpositive dimensions and a normalized minimum greater than the maximum; a failed matrix allocation has a separate matrix-size error. These are source findings, with no deliberate invalid input or resource-limit test. Keep example dimensions small and avoid assuming support for fractional dimensions or enormous arrays.

Official Help warns that an existing array’s dimensions do not change automatically when referenced Rows or Columns cells change: delete and re-enter the array formula. Array entry, resizing, random samples and GUI error displays remain untested here. There is no seed parameter or promise of a reproducible sequence.

Official evidence and checking scope

The review covers the retained documentation and exact 26.8.1.1 source. No application run is claimed for this guide. Array entry and dimension changes remain documented workflow, not GUI observations.