RANDARRAY Function
Generates an array of random numbers.
Syntax
Parameters
| Parameter | Description | Required |
|---|---|---|
| rows | The number of rows to return (defaults to 1). | Optional |
| columns | The number of columns to return (defaults to 1). | Optional |
| min | The smallest value (inclusive); defaults to 0. | Optional |
| max | The largest value (inclusive for integers); defaults to 1. | Optional |
| integer | FALSE 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)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)Example 2: Decimal grid within bounds
A 2x2 array between 0 and 1.Explicit bounds and decimals
=RANDARRAY(2, 2, 0, 1, FALSE)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.
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
RANDARRAY
randarrayPractice 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.
File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps