Google Sheets’ RANDARRAY function generates columns and rows of random decimals between 0 and 1. The possible outputs include 0 up to but not including 1.
Get your copy of these examples in a live Google Sheet.
Contents
Purpose
This RANDARRAY function returns an array of random decimals.
Syntax
=RANDARRAY(rows, columns
)
rows
– The number of rows of random decimals to generate- This argument is optional unless there are
columns
specified, then this argument is required.
- This argument is optional unless there are
columns
– The number of columns of random decimals to generate
Similar Functions
RANDBETWEEN – Generates a random integer with a value between the two numbers supplied to the function
RAND – Generates a random decimal amount between 0 and 1
Skip the functions and use the menu-driven Random Sampler Google Sheets add-on. This user-friendly tool creates random samples without formulas. Choose from simple, systematic, or stratified sampling techniques.
Example Use of the RANDARRAY Function
This animation shows an example of the RANDARRAY function.
Typing =RANDARRAY(4,3)
into a cell returns an array of random decimal values four rows high and three rows wide. This is significantly faster than using the RAND function in twelve cells.
Live Examples in Sheets
Go to this spreadsheet for examples along with RAND and RANDBETWEEN that you can study and use anywhere you want.
Notes
- The output of RANDARRAY changes whenever the spreadsheet changes or reloads (like TODAY, NOW, RANDBETWEEN and RAND).
- If you want the output to be static, consider using Copy and then Paste special as a value.
- Avoid using too many RANDARRAY functions in your spreadsheet; it can slow it down with extra recalculations.
- To force the random number to be recalculated more frequently, go to the File -> Settings -> Calculations, then change the setting from On change to On change and every minute or On change and every hour.