Quick Answer

RANDARRAY Function

Generates an array of random numbers.

✓ Excel✓ Google SheetsExcel Microsoft 365

Syntax

RANDARRAY
( [rows], [columns], [min], [max], [integer] )

Parameters

ParameterDescriptionRequired
rowsThe number of rows to return (defaults to 1).Optional
columnsThe number of columns to return (defaults to 1).Optional
minThe smallest value (inclusive); defaults to 0.Optional
maxThe largest value (inclusive for integers); defaults to 1.Optional
integerFALSE for decimal values (default) or TRUE for whole numbers.Optional

Basic Example

A 3-row by 2-column block of random decimals

=RANDARRAY(3, 2)
ResultSix random decimals between 0 and 1 in a 3x2 array

With no bounds supplied, RANDARRAY returns values from 0 to 1.

Advanced Examples

Example 1: Random integers in a range

Five random whole numbers from 1 to 100.

Set min, max, and integer

=RANDARRAY(5, 1, 1, 100, TRUE)
Result: Five random integers between 1 and 100
integer TRUE forces whole numbers within the 1-100 bounds.

Example 2: Decimal grid within bounds

A 2x2 array between 0 and 1.

Explicit bounds and decimals

=RANDARRAY(2, 2, 0, 1, FALSE)
Result: Four random decimals from 0 to 1
integer FALSE keeps the results as decimals.

How RANDARRAY Works

RANDARRAY returns an array of random numbers. With no arguments it returns a single random decimal between 0 and 1. rows and columns set the size, min and max set the bounds, and integer forces whole numbers. Like RAND, it recalculates and produces new values on every change.

1
Pick the size
Choose rows and columns.
2
Set bounds and type
Optionally set min, max, and integer.
3
Ensure spill space
Leave empty cells for the array.

Important Notes & Limitations

  • Microsoft 365 / Excel 2021+ only.

  • Volatile: recalculates on every change, which can slow large sheets.

  • min must be less than max; integer results are inclusive of the bounds.

Common Errors & Fixes

#VALUE! (min > max)The minimum exceeds the maximum.

Fix: Ensure min is less than max.

#SPILL!No room for the spilled array.

Fix: Clear the cells in the spill range.

Download Practice File

Practice RANDARRAY with Real Data

Download a sample CSV file with pre-populated data and practice exercises for the RANDARRAY function. Works in both Excel and Google Sheets.

Works in Google SheetsCompatible with ExcelIncludes exercises

File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps

Frequently Asked Questions

Is RANDARRAY in Google Sheets?
Yes, in recent Google Sheets versions; older Sheets may not support it.
How do I get integers?
Set the integer argument to TRUE.
Why do the values keep changing?
Like RAND, RANDARRAY is volatile and recalculates on every change.