Function · Dynamic arrays

Excel RANDARRAY function

The Excel RANDARRAY function spills random numbers and calculates a new set whenever the workbook calculates. The four integers on this page are one pictured draw from 1 through 50, not a result you can reproduce.

Microsoft 365, Excel 2021, Excel 2024, and Excel for the web. Also in Google Sheets.

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

RANDARRAY
=RANDARRAY(4,1,1,50,TRUE)

Arguments

NameRequiredWhat to pass
rowsOptionalHow many rows. The default is 1.
columnsOptionalHow many columns. The default is 1.
minOptionalThe smallest value. The default is 0. It is included.
maxOptionalThe largest value. The default is 1. For decimals, max is not included. For whole numbers, max is included.
whole_numberOptionalTRUE returns integers. FALSE, the default, returns decimals.

Examples

Four whole numbers from 1 through 50, frozen for the picture

=RANDARRAY(4,1,1,50,TRUE)

Result 17, 42, 8, and 33 in this picture

=RANDARRAY(4,1,1,50,TRUE)A1
Draw
A
117
242
38
433
A picture of the sheet, not a live calculator. 17, 42, 8, and 33 are one pictured draw so the page has numbers to see.

RANDARRAY spills a block of random numbers. Four whole numbers from 1 through 50 can be any integers in that range, and both ends can come up. The grid shows 17, 42, 8, and 33. Those are one pictured draw. Nothing in the formula asks for them, and the next calculation replaces them.

Decimals are the default. RANDARRAY(4) spills four decimals from 0 up to, but not including, 1, the same rule as RAND. Whole numbers include the maximum, the same rule as RANDBETWEEN. Paste values before you sort or share the draw. Excel 2019 does not have RANDARRAY. A blocked spill is #SPILL!.