# Generate Random number using RAND Function in Excel

RAND function in Excel generates a random real number between 0 and 1.  With the Help of Excel RAND Function we can also generate a random real number between any two values say a and b using the formula

RAND( ) * (b – a) + a

Where a and b are the values between which your random number will be

#### Syntax of RAND Function in Excel

1)  RAND()

2) RAND( ) * (b – a) + a

Syntax 1) for generating random number between 0  and 1

Syntax 2) for generating random number between a and b

#### Example of RAND Function in Excel

##### Formula

• Row number 2 generates random number between 0 and 1
• Row number 3 generates random number between 0 and 10
• Row number 4 generates random number between 0 and 100
• Row number 5 generates random number between 2 and 20

So the result will be

##### Result

NOTE:  Random number changes every time when you save or refresh

#### Example: Generate 10 Random Number between 0 and 1

Now as a part of exercise lets generate 10 random number between 0 and 1

Step 1 : Select cell A2  and type =RAND() and press Enter

Step 2 :  To generate a list of random numbers click and drag it till cell A11

Step 3:  Random number changes every time when you save or refresh. So select the generated random number, copy it and paste values as shown below so that it will not change when you refresh or save.

#### Example: Generate 10 Random Number between 35 and 135 with Decimals

To generate random number with decimals use the formula in Cell A2

=RAND( ) * (b – a) + a .

Drag it till A11  , the output will be like

#### Example: Generate 10 Random Number between 35 and 135 without Decimals

To generate random number with decimals use the formula  in the cell A2

=RANDBETWEEN(a,b)

Drag it till A11, the output will be like

RANDBETWEEN Function is explained detail in the next chapter