*Have you need random data for test? I usually use random data for excel function test. You can create random number in excel very easily and simple.*

In this tutorial, we will create random number in excel by Rand and Ranbetween command.

Post contents

## I. Create random number with rand() command.

Rand() command will give us random real number between 0 and 1. A new random real number is changed every time the worksheet is calculated.

Return value: Number between 0 and 1

Syntax: =RAND()

For this test, I will create 5 random numbers in excel.

+ 1st: Select cell you want to create random number.

+ 2nd: Typing =Rand()

+ 3rd: Hole left mouse and drag your mouse to the cell you want to create random number and press enter.

## II. Create random number by RANDBETWEEN command.

RANDBETWEEN command will give a number between two values.

Return value: An integer

Syntax: =RANDBETWEEN (bottom, top)

For this test, I will create 5 random numbers and between 20~30.

+ 1st : Select cell you want to create random number.

+ 2nd: Typing =Randbetween(20,30)

+ 3rd: Hole left mouse and drag your mouse to the cell you want to create random number and press enter.

### What can we do with randbetween command?

+ Random value from list or table.

To get a random value from a table or list in Excel, you can use the INDEX function with help from the RANDBETWEEN and ROWS functions.

Formula =INDEX(data,RANDBETWEEN(1,ROWS(data)),1)

+ Random value between two values.

Formula =Randbetween(lower,upper)

+ Random date between two dates.

Formula =Randbetween(date1,date2)

+ Random text values

Formula =CHOOSE(RANDBETWEEN(1,4),”Value1″,”Value2″,”Value3″,”Value4”)

+ Random number from fixed set of options.

Formula =CHOOSE(RANDBETWEEN(1,4),num1,num2,num3,num4)

## Leave a Reply