How to Use RAND and RANDBETWEEN Functions in Google Sheets

0
135
RAND and RANDBETWEEN Functions in Google Sheets

There are two random number generator functions in Google Sheets. They are RAND and RANDBETEEEN volatile Google Sheet functions. This time we can learn how to use RAND and RANDBETWEEN functions in Google Sheets.

There is not much complication in using RAND and RANDBETWEEN functions. They are just random number generators. You can very easily understand it and start to begin using.

Use of RAND and RANDBETWEEN Functions in Google Sheets

Let us start with RAND Google Spreadsheet function.

RAND Function in Google Sheets

You can directly use RAND function in any cell to generate random number as it doesn’t take any arguments unlike RANDBETWEEN. Here is the syntax.

=RAND()

This function returns a random number between 0 inclusive and 1 exclusive. That means the Google Sheets RAND formula can return a random number between 0 and 0.9999999. Suppose in Cell A1, you applied the rand function as”=rand()”, you will get one random number. If you delete and again apply the rand formula, this time you will get a new random number. The reason RAND is a volatile function and that’s why this function called random number generator.

The random number thus you generated is subject to change similar to time as well as date google sheet functions. When you make any changes on your spreadsheet, the random number will change. The frequency of this change you can control like every minute, every hour etc. The settings you can find Here.

Example to RAND Google Sheets Function

The main purpose of Google Sheets RAND function is to generate a random number between 0 and 1. Just check the below screenshot. Nothing more to explain about RAND function at this point.

RAND Function example in Google Sheets

RANDBETWEEN Function in Google Sheets

Unlike RAND Google Sheets function, RANDBETWEEN function takes arguments in it. Below is the syntax.

 RANDBETWEEN(low, high)

Here you can define high and low values. This formula can return a random integer between two values, both inclusive.

Example to RANDBETWEEN Google Sheet Functions

Formula one returns a random number between 1 and 10 both inclusive. The next formula, i.e., formula # 2 returns a random number between 10 and 20 and like wise.

rand between function example

How to Use RAND Function Instead of RANDBETWEEN Function

For me RAND function is more flexible. We can use it instead of RANDBETWEEN function by using with other functions.

You can easily get a unique integer between 0 to 100, where 100 is not inclusive, with the following RAND and TRUNC function combination.

=trunc(rand()*100)

Similarly 0 to 10, here also 10 is not inclusive.

=trunc(rand()*10)

You can further expand the usage of RAND function and to make it just to behave like RANDBETWEEN function. In RAND function also you can apply low and high value arguments indirectly.

We can use the same above TRUNC and RANDBETWEEN combination. In the above we can only have the control over the higher value. We can overcome this by straightway deducting our desired lower value from the output.

=trunc(rand()*(100-10)+10)

It will return a random number between 10 to 100. Here 100 is the highest and 10 is lowest argument. Here 10 is inclusive but 100 not.

=trunc(rand()*(10-1)+1)

Hope you enjoyed these tips. See you again with a practical example to RANDOM number in Google Sheets.

LEAVE A REPLY

Please enter your comment!
Please enter your name here