We have got many instances where we needed to generate a random database or values. Rand function is very useful for the users who creates random database for various types of working and analysis.
Rand Function generates values between 0 to less than 1. We always have output of the Rand function in decimals. The formula of RAND function is very simple because it has no arguments and provides the random output.
Below are the RAND Formula syntax commonly used in Excel:
1. =RAND()
RAND Function can be used to get the values in decimals, without decimals, values in pre-defined range, we will all discuss in following examples:
Suppose we need to create a database for the various types of stationery products and their prices for a month. There is one way to mention the random product name and prices one by one or we can use the “RAND” function to make the work easy. Here we will go ahead with using RAND Function:
Drag the formula to respective cells. i.e. Select Column + Ctrl + D
If we need to have the random values without decimal, we need to follow the below function. We can have any range based on the requirement; here we need the random values between 0 to 10.
Syntax: =INT(RAND()*10)
Above syntax will help to get the random values between 0 to 10. If we need to have values between 0 to 100, we will change the syntax and will mention 100 instead of 10
Syntax has limitation that it always gives values starting from 0, if we need to have values within user defined range follow the Example 3.
Suppose we need the random values between a range, between 10 to 100 then please follow below equation, where “b” can be 100 and “a” would be 10
Syntax =RAND()*(b-a)+a
Above function output always returns the value as per the value of “a” and “b” given in the formula. We can give any value in place of 10 or 100 to get the desired result.
We can also have the values between a user defined range and without decimals by following below syntax. For example, if we need the values between 10 to 100:
Syntax: =INT((RAND()*(b-a)+a))
Things to Remember:
– Values derived from RAND function changes each time worksheet is refreshed/ edited/open/changed. So, ensure to Paste special values the formula output so that database is not changed.
Below are the steps for paste special database to values:
– Select the data range -> Go to Menu Bar- > Click to Home-> Click to Copy
Then -> Go to Menu Bar- > Click to Home-> Click Paste Values
Hope you learnt this Function! you may comment in below comment box for any questions regarding this formula.
If you are liking our articles and want to learn more similar tricks, please do not forget to Subscribe us or follow us on Social Media.
Watch: How to use TODAY & NOW Function in Excel? What is TODAY Function? The TODAY function in Excel returns the current date in a serial number format. Click here to Read full Tutorial What is…
MOD function is used to get the remainder of number that is divided by divisor. MOD Function has two required arguments i.e. number and divisor.
In this tutorial, you will learn 3 effective approaches How to Extract First Line in Excel of text. formulas, regex. In data analysis, Excel is a powerful tool that helps make difficult tasks easier. One…
How to use the compound interest formula in Excel and gives examples of how to calculate the future value of an investment with yearly, monthly, or daily interest. It also shows you step-by-step how to make your own Excel compound interest calculator.
SUMIF function is used to get the “total sum” for number of times the criteria across range is met. SUMIF Function has two required arguments.
What is Absolute Value in Excel? The absolute value of a number is its distance from zero on the number line, regardless of direction, so it’s always a non-negative number. The ABS function in Excel…
Watch: How to use TODAY & NOW Function in Excel? What is TODAY Function? The TODAY function in Excel returns the current date in a serial number format. Click here to Read full Tutorial What is…
MOD function is used to get the remainder of number that is divided by divisor. MOD Function has two required arguments i.e. number and divisor.
In this tutorial, you will learn 3 effective approaches How to Extract First Line in Excel of text. formulas, regex. In data analysis, Excel is a powerful tool that helps make difficult tasks easier. One…
How to use the compound interest formula in Excel and gives examples of how to calculate the future value of an investment with yearly, monthly, or daily interest. It also shows you step-by-step how to make your own Excel compound interest calculator.
SUMIF function is used to get the “total sum” for number of times the criteria across range is met. SUMIF Function has two required arguments.
What is Absolute Value in Excel? The absolute value of a number is its distance from zero on the number line, regardless of direction, so it’s always a non-negative number. The ABS function in Excel…
Watch: How to use TODAY & NOW Function in Excel? What is TODAY Function? The TODAY function in Excel returns the current date in a serial number format. Click here to Read full Tutorial What is…
MOD function is used to get the remainder of number that is divided by divisor. MOD Function has two required arguments i.e. number and divisor.
In this tutorial, you will learn 3 effective approaches How to Extract First Line in Excel of text. formulas, regex. In data analysis, Excel is a powerful tool that helps make difficult tasks easier. One…
How to use the compound interest formula in Excel and gives examples of how to calculate the future value of an investment with yearly, monthly, or daily interest. It also shows you step-by-step how to make your own Excel compound interest calculator.
SUMIF function is used to get the “total sum” for number of times the criteria across range is met. SUMIF Function has two required arguments.
What is Absolute Value in Excel? The absolute value of a number is its distance from zero on the number line, regardless of direction, so it’s always a non-negative number. The ABS function in Excel…