How to Use RAND Function in Excel

This guide treats “use rand function in excel” the way busy spreadsheet users actually want it: answer first, a live tool to prove it on your own data, then the reasoning. It is written for Excel but calls out every place Google Sheets differs, and the platform toggle at the top switches all shortcuts between Windows and Mac so nothing here assumes the keyboard you are not on.

Exact answer

In Excel: use =RAND() — it returns a random decimal from 0 up to (but not including) 1, recalculating on every change in the workbook.

Syntax

=RAND()

Arguments

ArgumentDescription
randoptionalRAND takes no arguments — the empty brackets are required.

Related functions

RANDBETWEENINTMOD
ƒxRandom Numbers & List ShufflerLive
Result
6

Seed: 20260101

=RANDBETWEEN(A2,B2)
Ctrl+CthenCtrl+Shift+V+Cthen+Ctrl+VPaste values · WindowsMac

Need it as an auditable file?

Ships inside the linked template — formula-driven, unlocked, audit-ready.

View template

What this does

RAND returns a uniformly distributed decimal between 0 and 1. Taking no arguments, it is scaled by arithmetic: multiply by a span and add a floor to get any range. Its most useful property in practice is as a shuffling key — putting =RAND() beside a list and sorting by that column randomises the order, which is how you draw a sample without replacement. Like all random functions it is volatile and recalculates constantly, so anything meant to stay put must be frozen as values. The same idea underpins a lot of everyday Excel work, so the few minutes spent getting it right here pay back across every sheet you build afterwards. Treat it as a pattern, not a one-off, and it stops being something you look up and starts being something you reach for. Treat “use rand function in excel” as a small repeatable workflow rather than a one-off click you hope to remember next time. Use a small test block before the live file, so any surprise in the affected formula shows up while it is still harmless. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. That turns a calculation you can defend to a CFO or an auditor into a method you can reuse, explain, and defend when the workbook leaves your screen.

A worked example

A random decimal between 10 and 20: =RAND()*10+10. Shuffling a list: put =RAND() in column B beside the names in column A, then sort by column B. Assigning a random 30 % of rows to a test group: =IF(RAND()<0.3, "Test", "Control"). RAND is the general randomness primitive — sampling, shuffling and split-testing all reduce to it plus a comparison. A practical tip before you scale it up: build it once on a small block of test data, confirm the number against the tool on this page, and only then point it at your real sheet. That one habit catches almost every mistake while it is still cheap to fix, long before a wrong figure reaches a report or a colleague.

In Google Sheets

Google Sheets handles this almost identically to Excel. The formula syntax above is the same, and the menu lives under a slightly different label rather than a ribbon tab. Use the platform toggle at the top of the page to switch every keyboard shortcut between Windows and Mac, and expect at most cosmetic differences in naming. The aim was to get you unstuck fast and leave you a little more capable than a copy-paste would. The answer is at the top, the tool proves it, and the detail above shows why it holds — so the next time a colleague asks, you can answer without reaching for search. Treat “use rand function in excel” as a small building block rather than a chore. Once the inputs sit in their own cells and the formula reads from them, the same setup answers a dozen related questions with a tweak, and Excel keeps every dependent figure current as the data changes. The tool above is there so you can rehearse and verify before committing anything to a real workbook; the steps and worked example are there so the logic sticks. Get it right once and it stops costing you time — it starts saving it, every time the question comes back around.

Common mistakes

  • Forgetting the empty brackets; =RAND without them is read as a name and returns #NAME?.
  • Sorting a list by a live RAND column, which reshuffles as the sort recalculates — freeze the values first.
  • Using RAND where whole numbers are wanted; RANDBETWEEN does that directly.

Frequently asked questions

How do I get a random number in a specific range?

=RAND()*(max-min)+min gives a decimal in that range. For integers, use =RANDBETWEEN(min, max).

How do I shuffle a list?

Add a helper column of =RAND(), freeze it as values, then sort the list by that column.

Why do my random numbers keep changing?

RAND is volatile and recalculates whenever anything in the workbook changes. Paste Special → Values to fix them.

Other ways people ask this

This is also commonly searched as “excel function rand” and “excel rand function”. They describe the identical operation, so you are in the right place no matter how you phrased it.

Why do people search for this in so many different ways?

Because the same task has many names. “excel function rand”, “excel rand function” all point at the one operation explained on this page, which is why they all lead here.