Array

RANDARRAY Formula

Generates a dynamic array of random numbers with specified dimensions, range, and type (whole or decimal). Use RANDARRAY to create sample data sets, random test scores, simulated sales figures, or any scenario where you need multiple random values at once without copying RAND() or RANDBETWEEN() into many cells.

Syntax

RANDARRAY([rows], [columns], [min], [max], [whole_number])
ParameterDescription
[rows] (Optional.) Parameter of the RANDARRAY function.
[columns] (Optional.) Parameter of the RANDARRAY function.
[min] (Optional.) Parameter of the RANDARRAY function.
[max] (Optional.) Parameter of the RANDARRAY function.
[whole_number] (Optional.) Parameter of the RANDARRAY function.
Try RANDARRAY in Viztab — free, no signup

Examples

5x3 grid of random integers 1-100

Formula
=RANDARRAY(5, 3, 1, 100, TRUE)
Returns a 5-row by 3-column array of random whole numbers between 1 and 100. Values recalculate on each sheet change.

Random decimal percentages

Formula
=RANDARRAY(10, 1, 0, 1, FALSE)
Returns 10 random decimals between 0 and 1, useful for simulating probabilities or growth rates.

Random test scores

Formula
=RANDARRAY(30, 1, 60, 100, TRUE)
Generates 30 random test scores between 60 and 100 — great for creating sample classroom data.

Common Errors

#VALUE!

Rows or columns is zero or negative, or min is greater than max.

#CALC!

The resulting array is too large for the available worksheet space.

Tips

Freeze random values

RANDARRAY recalculates every time the sheet recalculates. To freeze values, copy the range and Paste Values (Ctrl+Shift+V) over the formula.

Generate sample data for testing

Use RANDARRAY to populate test data: random sales amounts, random ages, random scores. Combine with CHOOSE or INDEX to pick random names from a list.

Decimal vs whole numbers

Set the last argument to TRUE for integers (e.g., quantities, headcounts) or FALSE/omit for decimals (e.g., rates, percentages, measurements).

Try RANDARRAY in Viztab

Import your data and use RANDARRAY with 370+ other formulas. No signup required.

Open Viztab

Related Formulas