|
<< Click to Display Table of Contents >> RANDARRAY (create random matrix) |
Syntax:
RANDARRAY(Rows; Columns [; MinimumValue] [; MaximumValue] [; WholeNumber])
Description:
Returns an array with random values for the specified dimensions (rows, columns).
Rows is the number of rows for the dimension of the resulting array. If omitted, the default value 1 is used.
Columns is the number of columns for the dimension of the resulting array. If omitted, the default value 1 is used.
MinimumValue (optional) is the lower limit for the smallest value of the random numbers. If omitted, the default value 0 is used.
MaximumValue (optional) is the upper limit for the largest value of the random numbers. If omitted, the default value 1 is used.
WholeNumber (optional) defines whether whole numbers or decimal numbers are output for the random array. TRUE (or 1) means whole numbers, FALSE (or 0) means decimal numbers. If omitted, the default value 0 (FALSE) is used, i.e., a random array with decimal numbers is output.
Notes:
▪The function is designed so that it can automatically "spill" over into adjacent cells as required. For this reason, such functions are also called dynamic matrix formulas.
| If the function causes a spill over to adjacent cells in the results area, a #SPILL! error value will be displayed if those cells are already filled with content. |
▪If no row or column argument is specified, the function only returns a single value between 0 and 1.
Compatibility notes:
Microsoft Excel supports this function only in version 2021 or later. The function is unknown in older versions.
Example:
RANDARRAY(3, 4) results in the following 3x4 array with decimal numbers between 0 and 1.

RANDARRAY(3, 4, 10, 50) results in the following 3x4 array with decimal numbers between 10 and 50.

RANDARRAY(3, 4, 10, 50, TRUE) results in the following 3x4 array with whole numbers between 10 and 50.

See also:
Section Working with arrays, MUNIT, MDETERM, MINVERSE, MMULT, MSOLVE, TRANSPOSE, RAND, RANDBETWEEN