Syntax
=RANDARRAY([rows], [columns], [min], [max], [whole_number])Arguments
| Argument | Required | Description |
|---|---|---|
rows | Optional | Number of rows (1 when left out) |
columns | Optional | Number of columns (1 when left out) |
min | Optional | The smallest number (0 when left out) |
max | Optional | The largest number (1 when left out) |
whole_number | Optional | TRUE for whole numbers, FALSE for decimals |
How to use RANDARRAY
RANDARRAY is volatile: it recalculates every time the workbook changes, so its result can differ each time.
When RANDARRAY returns more than one value, the result spills into the cells below and to the right. Keep those cells empty, or you get #SPILL!.
RANDARRAY takes no required arguments and 5 optional arguments. Type =RANDARRAY( in a cell and SheetsBat shows the arguments as you go. Optional arguments are shown in square brackets; leave them out to use their default.
Examples
Each result below was calculated by the SheetsBat formula engine.
=RANDARRAY(2, 1, 7, 7, TRUE)Result =AND(RANDARRAY(3, 2)<1)Result =RANDARRAY(1, 1, 5, 1)Result Related math functions
- PRODUCTMultiplies numbers and the numbers in ranges.
- QUOTIENTReturns the whole number part of a division.
- RADIANSConverts an angle from degrees to radians.
- RANDReturns a random number from 0 up to (not including) 1, new on every recalculation.
- RANDBETWEENReturns a random whole number between two numbers (both included).
- ROMANConverts a number to Roman numerals as text; form 0 is classic and 1 to 4 are ever more concise.
- ROUNDRounds a number to a given number of digits, halves away from zero.
- ROUNDDOWNRounds a number toward zero to a given number of digits.
- ROUNDUPRounds a number away from zero to a given number of digits.