Excel has in-built functions that ease the process of generating random numbers. Sometimes, you may need to generate a dummy dataset that can be used to perform a given task in Excel. This article will discuss ways of generating random numbers in Excel.
Using the RAND function
Two methods can be used with this function to generate random numbers.
Using the Insert Function Tool
Step:
1. Open the Excel application.
2. Click on the cell that will hold your result.
3. Click on the Formulas tab on the screen, and then locate the Function Library section.
4. Click the Insert Function button to open the Insert Function dialogue box.
5. In the Search for a Function section, type RAND and press the Go button.
6. Select the RAND option in the Select a Function section and then hit the Ok button. On the next screen, click the Ok button to close the dialogue box. The random number will be added to the selected cell. Locate the dragging icon and drag the formula to other cells to add random numbers to other cells.
Using the Formula Bar
Steps:
1. Open the Excel application.
2. Click on an empty cell that will hold the results, and then click on the Formula bar.
3. Type the Equal sign followed by the RAND function. That is, =RAND (
4. Close the function and hit the Enter key. =RAND ( )
Using the RANDBETWEEN
Syntax
=RANDABETWEEN (Min, Max)
Min: This argument represents the minimum value of the function.
Max: This argument is used to set the maximum value of the function.
Below are the steps to use the function:
1. Open the Excel application.
2. Click on an empty cell that will hold the result, and then click on the Formula bar.
3. Type the Equal sign followed by the RANDBETWEEN function. That is, = RANDBETWEEN (
4. Type the argument of your function and hit the Enter key. For Example = RANDBETWEEN ( 5,20 )
Using the RANDARRAY Function
RANDARRAY is an in-built function used to generate an array of random numbers.
Syntax:
= RANDARRAY ( [rows], [columns], [min], [max], [whole_number] )
Rows: This is the number of rows the functions should return.
Columns: This argument is used to return the numbers of columns.
Min: This argument represents the minimum value of the function.
Max: This argument is used to set the maximum value of the function.
Whole_Number: This is a Boolean value used to determine the number generated. If TRUE, the function returns the whole number. On the other side, if FALSE, the function returns decimals numbers.
Below are the steps to use the function:
1. Open the Excel application.
2. Click on an empty cell that will hold the result, and then click on the Formula bar.
3. Type the Equal sign followed by the RANDARRAY function. That is, =RANDARRAY (
4. Type the argument of your function and hit the Enter key. For Example =RANDARRAY ( 1,2, 5,20, TRUE )