The RANDARRAY function is a dynamic tool that allows you to generate a grid of random numbers
ranging between 0 and 1. The exact dimensions of this generated output are completely customizable and are determined by the row and column arguments you provide.
Here’s a RANDARRAY formula that generates an array of random numbers between 0 and 1, across 10 rows and 3 columns:
=RANDARRAY(10, 3)
which gives an output:

RANDARRAY Function Syntax
The fundamental structure for this formula is =RANDARRAY(rows, columns). It is highly flexible and can accept zero, one, or two arguments to function properly. This means =RANDARRAY(), =RANDARRAY(10), and =RANDARRAY(5,5) are all perfectly valid inputs.
- rows: The first argument defines the total number of rows you want to return. This is an optional input. If you only provide a single argument to the formula, the software will automatically assign it to the row count.
- columns: The second argument specifies the total number of columns to generate. This is also optional. If you choose to leave it blank, the formula defaults to a value of 1.
RANDARRAY Function Examples
Depending on your data needs, you can manipulate the arguments to output numbers in various shapes and sizes across your array:
- Single cell: Running
=RANDARRAY()without any arguments produces a random number in one specific cell, acting exactly like the standard RAND formula. - Single column: Using a single argument, such as
=RANDARRAY(5), creates 5 random values stacked in a vertical orientation. - Single row: To generate numbers horizontally across a single row, set your first argument to 1, like this:
=RANDARRAY(1, 5). - Rows and columns: Providing two arguments creates a full grid. For instance,
=RANDARRAY(10, 5)populates random values across 10 rows and 5 columns.
RANDARRAY Function Notes
RANDARRAY is a volatile function, which means it recalculates every time your spreadsheet changes.
If you have a lot of RANDARRAY functions in your Sheet (or a lot of downstream formulas that reference a RANDARRAY function), then this can lead to slow Google Sheets because it will keep recalculating all those formulas with every change.
RANDARRAY can also be set to update hourly or even every minute.
Go to File > Settings > Calculation
Select the hour or minute options under the Recalculation dropdown menu:

To generate a single random number, use the RAND function.
To generate a random integer (whole number) between two values, use the RANDBETWEEN function.
Generate Random Whole Numbers With RANDARRAY
By wrapping your array inside a rounding formula, you can force the software to generate clean, whole numbers instead of lengthy decimals:
- 1 to 10: To create a grid of whole numbers between 1 and 10 across 10 rows and 5 columns, use
=ArrayFormula(ROUND(RANDARRAY(10,5)*10)). - 1 to 1000: For larger figures up to 1000, simply adjust the multiplier:
=ArrayFormula(ROUND(RANDARRAY(10,5)*1000)). - Custom range: To generate an array of whole numbers between two specific values, such as 250 and 700, use this specific calculation framework:
=ArrayFormula(ROUND(RANDARRAY(10,5)*(700-250))+250).
How To Sort A List Randomly Using A RANDARRAY Formula
RANDARRAY is useful for sorting lists randomly.
You assign each item in the list a random number between 0 and 1 and then sort those numbers in ascending order, which will randomize the order of the items.
For example, suppose there are 10 names in column A.
This formula combines the SORT function and RANDARRAY function to randomize the order:
=SORT(A1:A10,RANDARRAY(10),1)
The output is:

One thought on “How To Use The RANDARRAY Function In Google Sheets”