RANDARRAY Function
Returns a grid of random numbers, decimals or whole numbers.
Category
Math & Trig
Available in
Microsoft 365, Excel 2021+
Returns
An array that spills
Overview
RANDARRAY fills as many rows and columns as you ask with random numbers between a minimum and maximum.
Set the last argument to TRUE for whole numbers — a whole block of test data in one formula.
Syntax
=RANDARRAY([rows], [columns], [min], [max], [whole_number])
Arguments
| Argument | Required? | What it does |
|---|---|---|
| rows | Optional | How many rows. Default 1. |
| columns | Optional | How many columns. Default 1. |
| min | Optional | Smallest value. Default 0. |
| max | Optional | Largest value. Default 1. |
| whole_number | Optional | TRUE for integers, FALSE (default) for decimals. |
Examples
Example 1 — A block of test sales
10 rows × 4 quarters of whole-number sales between 100 and 900.
=RANDARRAY(10, 4, 100, 900, TRUE) Explain
Common mistakes
- #SPILL! Clear space for the whole grid.
Notes
- Related functions: RAND, RANDBETWEEN, SEQUENCE, SORTBY.

Author
Kyle Stott
Certified Microsoft Excel Expert
Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.