Google Sheets RANDARRAY Function: Syntax, Examples & Tips

The RANDARRAY function generates an array of random numbers between specified minimum and maximum values, with defined rows and columns.
Google Sheets
RANDARRAY(rows, columns)

One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.

On this page
  1. Parameters
  2. What is a RANDARRAY?
  3. A Practical Example
  4. RANDARRAY Formula
  5. Result of the Formula
  6. Why Use RANDARRAY?
  7. Key Takeaways:
  8. Example use case

Parameters

rows:
The number of rows to return in the array.

columns:
The number of columns to return in the array.

What is a RANDARRAY?

The RANDARRAY function in Google Sheets is a dynamic array function that generates an array of random numbers. This function allows users to create a specified number of random values in a defined range, making it a useful tool for simulations, random sampling, and various statistical analyses. Unlike the traditional RAND function, which only generates a single random number, RANDARRAY can produce multiple random numbers at once.

In simpler terms, RANDARRAY lets you quickly fill a range of cells with random numbers, saving you time and effort in generating data for testing or analysis.

A Practical Example

Imagine you are conducting a survey and want to randomly assign participants to different groups for an experiment. You need to generate random numbers to represent these groups.

Group Assignment Table:

ParticipantIDGroup
1
2
3
4
5

You want to assign each participant to one of three groups (1, 2, or 3) randomly.

RANDARRAY Formula

To achieve this, you would use the RANDARRAY function as follows:

Google Sheets
=RANDARRAY(5, 1, 1, 3, TRUE)

In this formula:

  • 5 is the number of rows you want to fill (one for each participant).
  • 1 is the number of columns you want to fill.
  • 1 is the minimum value of the random numbers (the lowest group number).
  • 3 is the maximum value of the random numbers (the highest group number).
  • TRUE indicates that the function should return whole numbers.

Result of the Formula

When you apply the RANDARRAY formula to the Group Assignment Table, the output might look like this:

ParticipantIDGroup
12
21
33
42
51

Each time you refresh the sheet or make changes, the group assignments will change, providing a new random distribution.

Why Use RANDARRAY?

RANDARRAY is beneficial because it simplifies the process of generating random numbers in Google Sheets. It allows for the creation of multiple random values in one go, which is particularly useful for simulations, randomized experiments, and data analysis. Additionally, since the values are dynamic, they automatically update whenever the sheet recalculates, ensuring you always have fresh data.

Key Takeaways:

  • RANDARRAY: A powerful function that generates an array of random numbers within a specified range.
  • Dynamic: Automatically updates the random values when the sheet recalculates, providing new data each time.
  • Versatile: Ideal for simulations, random sampling, and any scenario where randomization is needed.
  • Easy to Use: Quickly fills a range of cells with random numbers, saving time and effort.

RANDARRAY is an essential function for anyone working with data in Google Sheets, providing a straightforward way to enhance data generation and analysis capabilities.

Happy spreadsheeting!

Example use case

You have a table of sales data, and you want to randomly select 5 sales representatives for a bonus draw. Use the RANDARRAY formula to generate random numbers, then sort the list to easily pick the top 5 representatives based on their random scores.

Need more help with Google Sheets formulas?

Sign up for Better Analyst and get unlimited AI-powered formula generation, explanations, and advanced data analysis.

Explore all Google Sheets formulas

Browse our complete library of Google Sheets formula guides

Compare your options

Decide with evidence, not a sales pitch.

Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.

  1. 01ChatGPTOpen a balanced comparison prompt in ChatGPT.
  2. 02ClaudeOpen the same research prompt in Claude.
  3. 03PerplexityResearch the comparison with linked web sources.

AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.