In this article:

Random Number Generator in Google Sheets [2024 Update]

May 8, 2024

In this article we will show you how to create a random number generator in google sheets in just a few clicks using the RAND function. Simply follow the steps below.

How to Make a Random Number generator in Google Sheets

1. Select a Cell to Place the Random Number Generator

Select the cell where you want to place the random number generator. You can format your spreadsheet in advance. 

how to create a random number generator in google sheets

2. Insert the Formula =INT(RAND()*number) to the Selected Cell

We use the RAND function combined with to insert a random number generator to the selected cell. The syntax is

=INT(RAND()*number)

Where number is the largest number you want the random number generator to output and INT rounds off the output to the nearest whole number. For example, if you want the largest number to be 10, the formula will be:

=INT(RAND()*10)

random number generator google sheets

When you press enter, the resulting output will be a random number ranging from 0 to 10.

google sheets random number generator

The formula recalculates whenever you make any change in the contents of the sheet.

random number generator in google sheets

If you want the function to automatically recalculate, follow the next step.

3. Set RAND to Recalculate Every Minute or Hour

To set RAND to recalculate every minute or hour, change the recalculation settings of the sheet. Click File then select Settings

Click file, select settings

A box labeled Settings for this spreadsheet appears. 

Spreadsheet settings

Select the Calculation tab. 

Spreadsheet settings, calculation settings

Click the drop-down list, then select On change and every minute or On change and every hour, whichever is the best for your need.

Recalculate on change and every minute option highlighted

Click Save settings.

Sheet set to recalculate random number on change and every minute

The RAND function will now recalculate every minute or every hour. 

How to add a Google Sheets Random Number Generator Button

You can insert something close to a button so you can just click to generate a random number instead of trying to edit a cell just to make it generate new numbers. Here are the steps: 

1. Insert Formula =INT(RAND()*number)

First, you need to insert the random number generator. The formula is straightforward:

=INT(RAND()*number)

Where number is the largest number you want the random number generator to output and INT rounds off the output to the nearest whole number. For example, if you want the largest number to be 10, the formula will be:

=INT(RAND()*10)

Format the sheet then select a cell where you want the formula placed. 

how to make a random number generator in google sheets

Here is the result:

Random number generator inserted in google sheets

2. Select the Cell Where You Want the Button Placed

You can format your sheet to determine where to best place the button. 

Cell to contain random number generator button selected

3. Click Insert then Select Checkbox

Once you select where to place the button, click Insert then select Checkbox. 

Click insert select checkbox

You have now inserted a button! It’s not exactly a button but a checkbox. However, whenever you click the checkbox, you actually change the value of the cell containing it. Whenever you add a value or remove one from one of the cells, it forces the sheet to recalculate, making the RAND function give you a new value. 

Checkbox as random number generator button

Here is a screencap to see that this trick works: 

New random number generated for every click in the checkbox

If you enjoyed this article, you might also like our article on how to find the mean on Google Sheets or our article on how to change column width in Google Sheets. 

If you want to get a copy of our Google Sheets address book template, we also suggest checking out our detailed guide. 

Get Google Sheets productivity and automation tips delivered straight to your inbox
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
We'll email you 1-3 times a week — and never share your information.

Work less, automate more!

Use Lido to connect your spreadsheets to email, Slack, calendars, and more to automate data transfers and eliminate manual copying and pasting. View all use cases ->