• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Excel RANDARRAY Function

You are here: Home / Excel Functions / Excel RANDARRAY Function

The RANDARRAY function returns an array of random numbers between a specified minimum and maximum, and you can decide whether to return whole numbers of decimal values. It’s super useful for simulations and modelling.

The syntax is:

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

rows is optional. Here you can specify the number of rows to be returned.

columns is optional and allows you to specify the number of columns to be returned.

min is optional allowing you to specify a minimum random value.

max is optional allowing you to specify a maximum random value.

integer is optional, choose TRUE for an integer and FALSE for a decimal.

If you omit all arguments, RANDARRAY will return a single value between 0 and 1

Note: The RANDARRAY function is part of the new Excel Dynamic Arrays family. At the time of writing, Dynamic Arrays are only available in Office 365 and are currently in beta on the Insiders channel. Excel 2019 will not have the Dynamic Array functions.

Excel RANDARRAY Function Examples

We can use the RANDARRAY function to return a list of 5 random numbers between 0 and 1, as shown in the image below. Notice how the formula is in cell B14 and the results ‘spill’ into the cells below:

example 1

The spilling of the array is possible with the new dynamic array formula functionality.

In the next example we use RANDARRAY to return a 3 row x 2 column array. Again it spills the results:

example 2

If you prefer whole numbers you can use TRUE in the integer argument, as shown below. You'll also need to specify a min and max otherwise you'll end up with zeros and ones.

whole random numbers

If you want to return a row of random numbers you can omit the row argument, as shown below:

omit the row argument

And if you prefer your random numbers sorted you can wrap it in the SORT function:

wrap it in the SORT function

We can get creative with the new dynamic array functions to generate a list of randomly sorted numbers between 1 and 10, as shown below:

generate list of randomly sorted numbers

The SEQUENCE function simply returns an array of values from 1 to 10. The SORTBY function then uses 10 random values produced by RANDARRAY to sort them.

Download the Workbook

Enter your email address below to download the sample workbook.

By submitting your email address you agree that we can email you our Excel newsletter.
Please enter a valid email address.

Download the Excel Workbook. Note: This is a .xlsx file please ensure your browser doesn't change the file extension on download.

Related Tutorials

Excel FILTER Function Filter cells based on criteria.
Excel SEQUENCE Function Returns list of sequential numbers that increment as specified.
Excel SORT Function Sort cells or arrays in ascending or descending order.
Excel SORTBY Function Sort cells or arrays based on criteria.
Excel UNIQUE Function Extract a unique or distinct list from a range or array.

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
 
  • About My Online Training Hub
  • Contact
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Copyright © 2023 · My Online Training Hub · All Rights Reserved

Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.

Download A Free Copy of 100 Excel Tips & Tricks

excel tips and tricks ebook

We respect your privacy. We won’t spam you.

x