FormulaCraft

How to generate random numbers in Excel and Google Sheets

Topic:Data cleaning & shaping
Excel & Google Sheets
=RANDBETWEEN(1,100)

Verified example

Computed by a real spreadsheet engine on the sample data below.

Random Number

=RANDBETWEEN(1,100)100

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1For a random integer in a range, type =RANDBETWEEN(1,100) — replace 1 and 100 with your lower and upper bounds.
  2. 2For a random decimal between 0 and 1, use =RAND(). To scale it, multiply: =RAND()*100 gives a decimal between 0 and 100.
  3. 3To freeze the random values so they don't change, copy the cells and Paste Special → Values Only.

Tips

Need it for your exact data?

Describe your columns in plain English and get the precise formula for your sheet, with the right Excel or Sheets syntax.

Frequently asked

Why do my random numbers change every time I edit the sheet?

RAND and RANDBETWEEN are volatile — they recalculate whenever anything changes. Paste as values to lock them permanently.

How do I generate random numbers without repeats?

Use RAND() in a helper column and RANK() to assign unique positions, then INDEX into your source list using those ranks.

More on Data cleaning & shaping

See all →

Formulas used

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: