• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Excel Tutorials by Y. Acosta

Excel Tutorials + Tips

  • Excel Tutorials
  • Etsy Store
  • Other Resources
  • About Me
    • About Me
    • Contact Me
    • FREE Printable List of Top Excel Keyboard Shortcuts
  • FREE pdf of Top Excel Shortcuts!

How to Use the RANDARRAY Function to Generate Random Data in Excel (+ video tutorial)

❤ Support Free Excel Training by Sharing -

We may be compensated for your purchase of any of the products featured on this page – it helps us keep the lights on :)

If you use Microsoft 365 or Excel 2021, the RANDARRAY function just made generating random data sets in Excel a whole lot easier! Let’s take a look at this function.

What is the RANDARRAY function?

RANDARRAY is a dynamic array function that combines the features of the RAND and RANDBETWEEN functions, then adds even more tricks!!!!

So, what do I mean by this?

Like Excel’s RAND and RANDBETWEEN, RANDARRAY is a dynamic function that generates random numbers.

NOTE: a dynamic function is one that regenerates its result any time any change is made in the sheet.

But, unlike its predecessors, with RANDARRAY you can create random numbers to fill entire cell ranges in one go and more! All in a single formula.

With RANDARRAY, you can:

  • Use it like the RAND function to generate a single random number
  • Set the quantity of random numbers to generate by setting the number of rows and columns you want
  • Establish minimum and maximum limits to the random numbers generated – as you would with RANDBETWEEN
  • Set whether you want to see your results as decimals or as integers

This makes RANDARRAY the easiest way to generate large data sets of random values quickly!

Why use RANDARRAY???

RANDARRAY is customizable. You can use it to generate random numbers in whatever size range you want. For example, you could set an area that is 4 rows long and 10 columns wide.

It’s efficient for creating large data sets. You no longer need to copy and paste the RAND or RANDBETWEEN functions over and over. You can now do it all in a single formula, saving you time.

Likewise, if you need to edit the settings in the formula, you only need to do it once and it will affect all its results!

RANDARRAY is a dynamic array function. This means that, by inputting the function in a single cell, you can apply (or “spill”) its results to multiple, blank neighboring cells.

How to use RANDARRAY in Excel to Generate Random Numbers

With all the gushing and excitement for this function out of the way, let’s get to how you would use RANDARRAY!

The full RANDARRAY function is =RANDARRAY([rows],[columns],[min],[max],[integer])

Depending on what results you’re looking for, you may or may not need to use any of these fields. Wild, right?! Let’s look at some examples.

Insert a Single Random Value in Only One Cell

If you want to generate a single random number in a cell, as you would have with the old RAND function, you would simply type =RANDARRAY() and a random number between 0 and 1 will be generated for you.

Set the Number of Rows and/or Columns to Insert Random Numbers In

RANDARRAY makes it easy to set the quantity of random numbers generated; it has inputs for the number of rows and columns you want the results to be in.

You’ll find this option in the first two arguments of the function: =RANDARRAY([rows],[columns],[min],[max],[integer])

Here are some examples:

Use RANDARRAY to Insert Random Values in Rows Only

Let’s say you want to apply random values to the 10 rows below the cell in which you type the function, you would use: =RANDARRAY(10)

Example of RANDARRAY in Rows Only
Example of RANDARRAY in Rows Only

Use RANDARRAY to Insert Random Values in Columns Only

To insert random values into only the 5 columns to the right of your active cell, you would need to use a comma to “skip” over the first argument and type the number 5 for the second argument. Like this: =RANDARRAY(,5)

Example of RANDARRAY in Columns Only
Example of RANDARRAY in Columns Only

Set the Number of Rows and Columns to Include in the RANDARRAY Results

You can probably guess the next example! To insert random values into an area made up of 10 rows and 5 columns, you would type: =RANDARRAY(10,5)

Example of RANDARRAY 10 x 5 Cell Range
Example of RANDARRAY 10 x 5 Cell Range

Set Minimum and Maximum Values in RANDBETWEEN

Like in RANDBETWEEN, with RANDARRAY you can set minimum and maximum values for your random numbers.

You’ll find this option in the third and fourth arguments of the function: =RANDARRAY([rows],[columns],[min],[max],[integer])

Building on our last example, let’s say that we want for the random values in our 10 x 5 cell range to be no less than 200 and no more than 750. Our formula would look like: =RANDARRAY(10,5,200,750)

Example of RANDARRAY with a Minimum of 200 and Maximum of 750
Example of RANDARRAY with a Minimum of 200 and Maximum of 750

Set Your RANDARRAY results as Decimals or as Integers

With the final argument, you can set if you’d like for the results of the RANDARRAY function to be decimals or integers:

=RANDARRAY([rows],[columns],[min],[max],[integer])

The default for the function is decimal values (as you could probably tell by the results in our earlier examples).

This means that, if you want your results to be in decimal form, you can just press Enter and skip this argument altogether.

But, if you want for your random values to be integers, you’ll need to select that in your final argument. You can do so by either typing “False” or the number “2.”

=RANDARRAY(10,5,200,750,FALSE) or =RANDARRAY(10,5,200,750,2)

SIDEBAR: The difference between an integer and a whole number is that integers can be negative. So, all whole numbers are integers, but only positive integers are whole numbers.

Example of RANDARRAY Function with Integer Results
Example of RANDARRAY Function with Integer Results

NEXT: Learn Ways to Add a Zero in Front of a Number in Excel (+ video tutorial)

FYI: This tutorial was created using the desktop version of Excel in Microsoft 365.

Related Articles:

  • How to Generate Random Numbers in Excel Using the RAND Function and the RANDBETWEEN Function
    Generate Random Numbers Using RAND +…
  • Randomize Lists in Excel - Pick a Winner, Shuffle Data, and More! - Tutorial (featured image)
    Randomize a List in Excel: Pick a Winner,…
  • How to Generate a Password Using Random Letters and Numbers in Excel - Tutorial
    How to Make a Password with Random Letters…

❤ Support Free Excel Training by Sharing -

blank

About Y. Acosta

Yil's (pronounced like "Jill") passion for Excel spreadsheets can be traced back to her days in marketing, where she spent significant time working on analytics. As a content creator, she now specializes in Excel spreadsheet tutorials. Make sure to visit the About page to learn more.

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Follow us:

Latest Tutorial:

Featured image for How to Use Find & Replace to Remove Wildcard Characters in Excel article

Click Here for More Excel Tutorials!!!

Get Your FREE pdf of Top Excel Keyboard Shortcuts!

* indicates required

blank

Image-button for Invoice Template for Etsy

Copyright © 2025

  • Home
  • Excel Tutorials
  • Resources
  • About Me
  • Privacy Policy & Terms of Use
  • Disclaimer
  • Advertiser Disclosure
  • Contact Me
  • FREE Printable List of Top Excel Keyboard Shortcuts
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
SettingsAccept
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT