Generate random number between two numbers with two decimal places
This tutorial shows how to generate a random number between two numbers with 2 decimal places using the ROUND, RANDBETWEEN and RAND functions
EXCEL FORMULA 1. Generate random number between two numbers with two decimal places with ROUND, RANDBETWEEN and RAND functions
EXCEL
Hard coded formula
Cell reference formula
=ROUND(RANDBETWEEN(5,25-1)+RAND(),2)
=ROUND(RANDBETWEEN(B5,C5-1)+RAND(),2)
|
GENERIC FORMULA
=ROUND(RANDBETWEEN(bottom_num,top_num-1)+RAND(),2)
ARGUMENTS GENERIC FORMULA
=ROUND(RANDBETWEEN(bottom_num,top_num-1)+RAND(),2)
ARGUMENTS EXPLANATION This formula uses the ROUND, RANDBETWEEN and RAND functions to generate a random number between two numbers with two decimal points.
The RANDBETWEEN function is used to return a random integer number between two specific numbers. The bottom number is applied as is, however the formula subtracts 1 from the top number given that we add on a number derived from the RAND function, which returns a random decimal or integer number between 0 and 1. Finally, the formula uses the ROUND function, with a number of digits criteria set to 2 to round the random number generated through a combination of the RANDBETWEEN and RAND function. This will return a random number between the set range, with two decimal places. In this example we are returning a random number between 5 and 25, with two decimal points.
Click on either the Hard Coded or Cell Reference button to view the formula that has the bottom and top numbers directly entered into the formula or referenced to specific cells. |
RELATED TOPICS
Related Topic | Description | Related Topic and Description |
---|---|---|
Generate random number between two numbers | How to generate a random number between two specific numbers | |
Generate random number between two numbers with decimals | How to generate a random number between two numbers with decimals | |
Generate random numbers | How to generate random numbers between 0 and 1 |
RELATED FUNCTIONS
Related Functions | Description | Related Functions and Description |
---|---|---|
RANDBETWEEN Function | The Excel RANDBETWEEN function returns a random number between two specified numbers | |
RAND Function | The Excel RAND function returns a random number between 0 and 1 | |
ROUND Function | The Excel ROUND function returns a rounded number in accordance with the specified number of digits |