1. Home
  2. Functions
  3. Math
  4. RANDARRAY
MathVolatile

RANDARRAY function

Returns an array of random numbers; you choose the size, the range and whether they are whole numbers.

Syntax

=RANDARRAY([rows], [columns], [min], [max], [whole_number])

Arguments

ArgumentRequiredDescription
rowsOptionalNumber of rows (1 when left out)
columnsOptionalNumber of columns (1 when left out)
minOptionalThe smallest number (0 when left out)
maxOptionalThe largest number (1 when left out)
whole_numberOptionalTRUE 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 Changes on every recalculation
=AND(RANDARRAY(3, 2)<1)Result TRUE
=RANDARRAY(1, 1, 5, 1)Result "#VALUE!"

Every formula, right in your browser

SheetsBat calculates 536 functions, with charts, pivot tables and live collaboration. Free to start.