HomeGoogle DocsSpreadsheetHow to Use RAND and RANDBETWEEN Functions in Google Sheets

How to Use RAND and RANDBETWEEN Functions in Google Sheets

Published on

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 it.

Update: There is one more new similar function called RANDARRAY. Read about that here – How to Use the RANDARRAY Function in Google Sheets.

Use of RAND and RANDBETWEEN Functions in Google Sheets

Let us start with the RAND Google Spreadsheet function.

RAND Function in Google Sheets

You can directly use RAND function in any cell to generate a random number as, unlike RANDBETWEEN, it doesn’t take any arguments.

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’ve inserted the above RAND function. Then you will get one random number. If you delete and again insert 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 generated will be subject to change similar to the TIME as well as DATE Google Sheets functions.

I mean, when you make any changes to your spreadsheet, the random number will get change similar to the NOW() function. But you can control the frequency of this change like every minute, every hour, etc. That setting you can find here.

Example to the 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.

Syntax

RANDBETWEEN(low, high)

Arguments

low – The low end (the smallest integer) of the random range.

high – The high end (the largest integer) of the random range.

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

Example to the RANDBETWEEN Google Sheets Function

In the below examples, formula one returns a random number between 1 and 10 both inclusive.

The second formula returns a random number between 10 and 20. The other formulas in the example follow this pattern.

rand between function example

How to Use RAND Function Instead of RANDBETWEEN Function (The Flexible Random Number Generator)

For me, the RAND function is more flexible. We can use it instead of RANDBETWEEN in combination 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. For this, we can use the same above TRUNC and RAND combination.

In the above, we can only have control over the largest value. We can overcome this by 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 largest and 10 is the lowest argument. Here 10 is inclusive but 100 not. See one more example (1 lowest, 9 largest).

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

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

Related:

  1. How to Pick a Random Name from a Long List in Google Sheets.
  2. How to Shuffle Rows in Google Sheets Without Plugin.
  3. Pick Random Values Based on Condition in Google Sheets.
  4. How to Randomly Select N Numbers from a Column in Google Sheets.
  5. How to Randomly Extract a Certain Percentage of the Rows in Google Sheets.
  6. Google Sheets: Macro-Based Random Name Picker.
  7. How to Generate Odd or Even Random Numbers in Google Sheets.
Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

Excel Word Count: Beyond SUBSTITUTE

You might want to count the number of words in a cell in Excel...

Sum by Quarter in Excel: New and Efficient Techniques

Knowing how to sum by quarter is crucial in Excel because quarterly reporting has...

Sum By Month in Excel: New and Efficient Techniques

Suppose you prefer to sum by month in Excel using a formula. In that...

How to Create An In-Cell Progress Bar in Excel

In-cell progress bars in Excel refer to bars that are within a cell, not...

More like this

Count Distinct Values in Google Sheets Pivot Table

There is a built-in function for counting distinct values in a Google Sheets Pivot...

Conditional Formatting for Pivot Tables in Google Sheets

Do you know how to dynamically restrict conditional formatting within the Pivot Table area...

XLOOKUP in Merged Cells in Google Sheets

In Google Sheets, merging cells is not a good idea if you intend to...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.