How to use the RANDARRAY function to randomly classify data in Excel
The RANDARRAY function is useful for performing tasks such as randomly sorting people into groups. This guide covers the definition and usage of this Excel function.
What is the RANDARRAY function in Microsoft Excel?
The RANDARRAY function in Excel is a dynamic array function that returns an array of random numbers based on the number of rows, columns, and min and max values you specify. The return value of the dynamic array function will automatically overflow into surrounding cells.
Syntax of the RANDARRAY function:
=RANDARRAY([rows],[columns],[min],[max],[integer])
In there:
- Rows (optional) represents the number of rows to fill. By default, this is 1 row.
- Columns (optional) is the number of columns to fill. By default, this is 1 column.
- Min (optional) is the smallest random number to return. Default is 0.
- Max (optional) is the largest random number returned. Default is 1.
- Integer (optional) defines the type of value to return. TRUE represents an integer, while FALSE, the default, represents a decimal number. You should note that the integer argument is required if you want to return an integer.
Because all parameters in the RANDARRAY function are optional, it returns a value if only one argument is specified. Therefore, you can return an array of numbers based on the number you set in one of the following four arguments: row, column, min, and max. a value.
How to use the RANDARRAY function in Excel
Explore the row and column arguments of the RANDARRY function
Let's say you want random data to occupy 5 rows and 4 columns.
1. Select a cell to enter the formula. We will use cell B3 .
2. In the formula bar, enter function = RANDARRAY( .
3. This formula calls the RANDARRY function to determine the number of rows. Write 5 .
4. Next, this function calls the set number of columns. Write 4 .
5. Write 5 , then comma and 4 .
6. Write a ) to close the parentheses because we will not use other arguments in this first example.
7. Press Enter .
The final syntax would be:
=RANDARRAY(5,4)
After pressing Enter , the formula returns random decimals spread across 5 rows and 4 columns because you specified 5 for the row and 4 for the columns in the formula. This means your formula worked properly.
Explore the min and max arguments of the RANDARRY function
Using two other optional parameters, min and max, you can return an array of random numbers and specify the minimum and maximum numbers in the array.
Start where you left off in the previous example. This example wants the smallest number to be 20 and the largest number to be 100 .
1. Select the cell where you want to enter the formula. Here is cell B3 .
2. In the formula bar, enter:
=RANDARRAY(5,4,20,100)
This formula works just like the previous one. The only difference is specifying 20 and 100 as the smallest and largest numbers.
3. Press the Enter key . This new formula will return random decimal numbers from 20 to 100 spread across five rows and four columns.
Explore the integer argument of the RANDARRY function
The previous two examples return decimals because, by default, if not specified, RANDARRAY will return decimals. To get an integer or integer, you must specify TRUE for the integer argument in the formula.
1. Select the cell where you want to enter the formula (B3).
2. In the formula bar, enter the formula below and press Enter.
=RANDARRAY(5,4,20,100,TRUE)
Note that all numbers are integers. That's what TRUE in the formula does. If you change TRUE to FALSE, the RANDARRAY function will return a decimal number in the Excel spreadsheet.
Above is how to use the RANDARRY function in Excel . Hope the article is useful to you.
You should read it
- How to use the SUM function to calculate totals in Excel
- How to use Hlookup function on Excel
- How to use the WRAPROWS function in Excel
- How to use the NPER function in Excel to plan loans and savings
- How to use the IFS function in Excel 2016
- How to use the LEN function in Excel
- How to use COUNTIF function on Excel
- How to use function keys in Microsoft Excel
May be interested
- How to use the FILTER function in Excelif you regularly work with data sets in excel, you know how important it is to be able to quickly find the information you need.
- How to use the FIND and REPLACE functions in Excel?when working with excel spreadsheets with big data, finding and replacing data cells if you do it manually will be very time consuming.
- Cell counting function with data in Excel - Enclose examplethe function to count cells with data in excel. in excel supports the data counting function to help you summarize the fastest way. the following article introduces data counting functions in excel.
- How to use the Match function in Excelthe match function on excel looks for a value defined in an array, cell range on the data table and returns the position of the value in the array, that range.
- Multiplication function (PRODUCT function) in Excelthe multiplication function in excel is very important for those who often have to process and calculate data in excel. in excel you can also use the * operator to multiply data, but with large amounts of data you should use the multiplication function - product to get
- How to use the NORMDIST function in Excel - Function that returns the distribution in Excelthe normdist function returns a distribution with a specified mean and standard deviation. the normdist function has applications in statistics, including hypothesis testing.
- How to use the SUM function to calculate totals in Excelsum is a popular and very useful excel function, and is also a basic arithmetic function. as its name suggests, the sum function is used to calculate totals in excel. and the parameters can be single parameters or ranges of cells. in this article, tipsmake.com will guide you to use the sum function to calculate the sum in excel, the common errors when calculating sum by sum and how to fix it.
- Instructions on how to use the Dmax function in Excelthe dmax function in excel is used to find the maximum value in the data table with conditional depending on the conditions that the user uses.
- How to use AVERAGEIF function in Excelaverageif function on excel is a conditional plus average function in the data table, with the given conditions set by the user.
- How to use the LEN function in Excelthe len function in excel is used to measure the length of a certain string of characters, including spaces and correctly return the total character for the user.