Rand array
Syntax:¶
RANDARRAY([rows], [columns], [min], [max], [whole_number])
- rows (optional): The number of rows to fill with random numbers. Defaults to
1if omitted. - columns (optional): The number of columns to fill with random numbers. Defaults to
1if omitted. - min (optional): The smallest value for the random numbers. Defaults to
0if omitted. - max (optional): The largest value for the random numbers. Defaults to
1if omitted. - whole_number (optional): A logical value (
TRUEorFALSE) specifying whether only whole numbers should be returned:TRUE: Generates whole numbers.FALSEor omitted: Generates decimal numbers.
Examples:¶
-
=RANDARRAY():- Returns a single random decimal between
0and1.
- Returns a single random decimal between
-
=RANDARRAY(3, 2):- Returns a
3x2array of random decimal numbers between0and1.
- Returns a
-
=RANDARRAY(2, 4, 5, 10):- Returns a
2x4array of random decimal numbers between5and10.
- Returns a
-
=RANDARRAY(3, 3, 1, 100, TRUE):- Returns a
3x3array of random whole numbers between1and100.
- Returns a
-
=RANDARRAY(5, 1, -10, 10, FALSE):- Returns a
5x1array of random decimal numbers between-10and10.
- Returns a
Note: The
RANDARRAYfunction is a dynamic array formula, meaning it will automatically spill into adjacent cells. Ensure enough space is available in the worksheet to avoid a#SPILL!error.