2.1 Random Samples
The one you will find most convenient for our labs is the function RANDBETWEENN(bottom,top), which Returns a random integer number between the numbers specified in the function’s arguments. The other random functions are RAND()
, which returns an evenly distributed random real number greater than or equal to 0 and less than 1, and RANDARRAY(rows,columns,min,max,integer)
, which Returns an array of random numbers. For RANDARRAY, you can specify the number of rows and columns to fill, minimum and maximum values, and whether to return whole numbers or decimal values.
We focus now on the RANDBETWEEN
function.
2.1.1 Insert the function RANDBETWEEN on a PC
To use RANDBETWEEN
, select a cell in the active worksheet. Click in the formula tab and then click the Insert Function
ribbon.
Select the category All
in the dialog window. Then select RANDBETWEEN
and then fill in the bottom and top numbers. Returns a random integer number between the numbers you specify.
2.1.2 Insert the function RANDBETWEEN on a MAC
- Click on the
Formula
tab. - Click the
Insert Function
ribbon. - You will see on the right side of the Excel window that the
Formula Builder
appears. - In the search box, start to type a keyword for the function you are looking for. Excel will list functions that match the criteria of the search you type.
- Then select the function you wish to insert in the worksheet. In this case, the
RANDBETWEEN
function. - Adjust the arguments of the formula (top and bottom numbers) as needed.
Note: Alternatively, you can simply type =RANDBETWEEN(bottom,top)
in the formula bar, with numbers in place of bottom and top for the arguments of the formula.