ReferenceFunctionsLookup Functions
RANDARRAY
RANDARRAY: Generates a random spilled array of numbers.
Summary
RANDARRAY can return decimal values or whole numbers in a specified range.
Remarks
- Defaults:
rows=1,columns=1,min=0,max=1,whole_number=FALSE. - The function is non-deterministic and recalculates to new values.
- For whole numbers, values are generated in an inclusive integer range.
rows <= 0,columns <= 0, or invalid integer bounds return#VALUE!.
Examples
Generate a 2x3 decimal matrix
Grid
| Cell | Value | |
|---|---|---|
| No inputs on Sheet1. | ||
Formula
=
Result
Not evaluated yet.
Expected
2x3 array of decimals in [0,1)
Generate six integer dice rolls
Grid
| Cell | Value | |
|---|---|---|
| No inputs on Sheet1. | ||
Formula
=
Result
Not evaluated yet.
Expected
6x1 array of integers from 1 to 6
Related functions
FAQ
Are RANDARRAY bounds inclusive?
In whole_number mode, min and max are inclusive integer bounds; in decimal mode values are generated over the numeric interval from min toward max.
Why does RANDARRAY recalculate on every recalc pass?
RANDARRAY is volatile and non-deterministic by design, so its spilled results are regenerated each evaluation.
Runtime metadata
Category
Lookup
Signature
RANDARRAY(arg1?: Number, arg2?: Number, arg3?: Number, arg4?: Number, arg5?…: Logical)Arity
min 0, max variadic
Arguments
arg1optionaldefaultNumber · Scalar · coercion NumberLenientText
arg2optionaldefaultNumber · Scalar · coercion NumberLenientText
arg3optionaldefaultNumber · Scalar · coercion NumberLenientText
arg4optionaldefaultNumber · Scalar · coercion NumberLenientText
arg5optionaldefaultLogical · Scalar · coercion Logical
Caps
noneSource