Arrow
Back to guides
Google Sheets Formulas

RAND Function in Google Sheets: Explained

In this article, you will learn how to use the RAND formula in Google Sheets.

What does the RAND do in Google Sheets?

The RAND function in Google Sheets generates a random number between 0 and 1, exclusive. The number is generated each time the worksheet is calculated, so it will be different every time the spreadsheet is opened.

How to use the RAND formula in Google Sheets

Follow these steps to use the RAND formula in Google Sheets:

  • Open a spreadsheet in Google Sheets.

  • Select the cell where you want to display the random number.

  • Type "=RAND()" into the cell.

  • Press Enter. The cell will display a random number between 0 and 1.

The general syntax of the RAND function is as follows:

As you can see, this function doesn’t have any argument in the formula. So, you don’t need to input any value for this formula. However, as the RAND function does not accept arguments, you cannot specify a specific seed value or control the distribution of the random numbers it generates.

If you need more control over the random numbers generated in your worksheet, you may consider using the RANDBETWEEN function instead.

Your next financial spreadsheet could be right here!
100+ spreadsheet templates, from FP&A to tax planning.
Free Spreadsheet Templates

How can I use the RAND formula with other formulas?

You can also use the RAND function in other formulas and functions, such as the IF function, to create more complex calculations. For example, you can use the RAND function to randomly assign a value to a cell based on a certain probability.

Here's an example of how to use the RAND function with the IF function to randomly assign a value to a cell:

=IF(RAND()<0.5, "Yes", "No")

This formula will generate a random number between 0 and 1, and if the number is less than 0.5, it will display "Yes" in the cell. If the number is greater than or equal to 0.5, it will say "No" in the cell. This creates a 50% probability of the cell displaying "Yes" and a 50% probability of the cell showing "No".

How to use the RAND function with the IF function 
How to use the RAND function with the IF function in Google Sheets

How to generate random numbers within a specified range in Google Sheets?

You can leverage this formula to show random numbers between specific figures. This formula generates a random number between 0 and 1. Thus, you can multiply it by the difference between the maximum and minimum values of the particular range, and then adds the minimum value to the result.

This will generate a random number within the specified range.

For example, to generate a random number between 1 and 10, you can use the following formula:

=RAND()*9+1

This formula will generate a random number between 0 and 9, and then add 1 to the result so that the final number will be between 1 and 10.

Use the RAND function to generate random numbers
How to use the RAND function to generate random numbers between 1 and 10

You can also use the RANDBETWEEN function to generate a random integer within a specific range.  To learn about the RANDBETWEEN formula, you can refer to this article: TBU

What is the difference between RAND and RANDBETWEEN functions in Google Sheets?

The RAND and RANDBETWEEN functions are used to generate random numbers in Google Sheets, but they have some differences. The main difference between the RAND and RANDBETWEEN functions is the type of numbers they generate.

The RAND function generates a random number between 0 and 1, with a uniform distribution. On the other hand, the RANDBETWEEN function generates a random integer within a specific range. It takes two arguments: the minimum and maximum values of the range.

The function generates a random integer between these two values, including both the minimum and maximum values.

The world's top businesses trust LiveFlow to automate their financial reporting
We turn Quickbooks Online data into a live FP&A dashboard in Sheets FAST!
Book a Demo

Learn how to do this step-by-step in the video below 👇

Automate financial reporting with LiveFlow

Cta Photo

Want to eliminate manual updates of your Excel & Google Sheets models?

Yes, show me how

Need help?

Our team is here to help you any time between 9am and 10pm EST.
Check Icon
Email us at: help@liveflow.io

Liked this article? Then you'll love the ones below