Google Sheets RAND Function: How to Generate Random Numbers
In this article
The RAND function in Google Sheets returns a random decimal number between 0 (inclusive) and 1 (exclusive) every time the sheet recalculates. Type =RAND() into an empty cell and press Enter and you get something like 0.4738291. That is all it takes. From there you can scale it up to random dice rolls, random whole numbers, random picks from a list, and shuffled rows. Nothing needs to be installed or enabled first; RAND is built into every Google Sheets account and works the same on the web version and the mobile apps.
What You'll Need
- A Google account and a spreadsheet open in Google Sheets (web browser or the iOS/Android app).
- Edit access to the sheet, so you can type formulas into cells.
- Optional but useful: a list of items in one column if you plan to pick a random name, winner or product.
One thing to know before you start: RAND is volatile. It recalculates whenever anything in the sheet changes, whenever the file is reopened, and on a timer. So a value you see now will almost certainly be different a few seconds later. If you need a random result to stay fixed, you must convert it to a static value, which is covered in the steps below. Label wording in menus can differ slightly by version, device or region, but the formula itself is identical everywhere.
Step-by-Step
- Click an empty cell. Any cell works. Pick one away from your data so a changing number does not confuse you later, for example D2.
- Type
=RAND()and press Enter. The parentheses are required even though RAND takes no arguments. You will see a decimal like 0.1823946. On the mobile app, tap the cell, then tap the formula bar or the function icon, type the same text and tap the checkmark. - Fill the formula down a column if you want several numbers. Select the cell, drag the small blue square at its bottom-right corner down, or copy the cell and paste it into the range below. Each cell gets its own independent random value.
- Scale it to a range you actually want. A number between 0 and 1 is rarely the goal. Multiply RAND by the size of the range and add the starting point:
- Random decimal from 1 to 10:
=RAND()*9+1 - Random whole number from 1 to 10:
=ROUNDUP(RAND()*10,0) - Random whole number from 1 to 6, like a die:
=RANDBETWEEN(1,6) - Random price between 5 and 15 rounded to a cent:
=ROUND(RAND()*10+5,2)
- Random decimal from 1 to 10:
- Pick a random item from a list. If your names sit in A2:A10, use
=INDEX(A2:A10,RANDBETWEEN(1,9)). The RANDBETWEEN gives a row position and INDEX returns whatever is in that row. Adjust the 9 to match the number of items. - Sort by a random column to shuffle rows. Add a helper column filled with
=RAND()beside your data, select the whole block including the helper column, then open Data and choose Sort range. Sort by the helper column, ascending or descending. Then delete or hide the helper column. - Freeze the results when you are happy with them. Select the cells with the random values, press Ctrl+C (Cmd+C on Mac), then use Paste special and choose Values only, or press Ctrl+Shift+V. This replaces the formulas with their current numbers so they stop changing.
Common Mistakes
- Expecting the number to stay put. The single biggest surprise. Every edit anywhere in the sheet can re-roll every RAND formula. Copy and paste as values before sharing or printing.
- Forgetting the parentheses. Typing
=RANDwithout them usually produces an error or a reference to a named range that does not exist. - Thinking RAND includes 1. It does not. It returns values from 0 up to but not including 1. If you need both ends, use RANDBETWEEN or add a rounding function.
- Comparing duplicates. Google Sheets recalculates in a way that can leave two RAND cells equal for a moment. Do not build anything that assumes all values are unique; if uniqueness matters, add a tiebreaker or paste as values and check.
- Using RANDBETWEEN for decimals. RANDBETWEEN returns whole numbers only. Divide or use RAND for fractions.
- Building a random roster and then editing the sheet. Any later change reshuffles it. Freeze the assignment as values first.
Tips
- To re-roll everything on demand, select a blank cell outside your data and press Delete. That counts as an edit and forces a recalculation.
- Set your spreadsheet to manual recalculation if you want stable randomness for a while. Open File, then Settings, and look for the calculation tab; the exact wording varies by version. This keeps values steady until you choose to recalculate, but remember to switch it back or your other formulas will look stale.
- Combine RAND with SORT to shuffle a whole dataset in one formula:
=SORT(A2:B10,RANDARRAY(ROWS(A2:B10)),TRUE). RANDARRAY creates a column of random numbers sized to your data. - For lottery-style draws without repeats, add a RAND helper column, sort by it, then take the first N rows. That guarantees no duplicate winners, which pure RAND picks cannot.
- Round explicitly with ROUND when you need a fixed number of decimals. Otherwise you get seven-decimal precision you probably did not ask for.
- Keep random formulas in a clearly labelled helper column so nobody mistakes a live random value for real data.
Troubleshooting
The formula shows as text instead of a number. The cell is probably formatted as Plain text. Select it, open Format, choose Number, then re-enter the formula. You may need to retype it because the leading equals sign was stored as text.
You get #NAME? or #ERROR!. Check the spelling and the parentheses. RAND must be written exactly, with no space before the bracket. If you are using INDEX with RANDBETWEEN, confirm the count of items matches your actual range; a row position larger than the list produces #REF!.
The numbers keep changing while you work. That is normal volatility. To stop it for good, paste as values. To stop it temporarily, switch to manual recalculation as described in the Tips section.
Every value in a column is identical. Typically you copied the cell and pasted without relative references adjusting, or you wrote a cell reference inside RAND. RAND takes no arguments, so each cell should contain the literal =RAND().
Random picks keep landing on the same person. With a small list, repeats are statistically likely, not a bug. Each pick is independent, so a nine-person list will show repeats often. Use the sort-and-take-N method if you need distinct winners.
The random selector still changes after you shared the file. Anyone with edit access changes the sheet when they open and type, which triggers recalculation. Freeze values before sharing read-only, or protect the range.
Frequently Asked Questions
Does RAND ever return exactly 1?
No. RAND returns a value greater than or equal to 0 and strictly less than 1. Use RANDBETWEEN if you need an inclusive upper limit.
How do I get a random whole number between two values?
Use =RANDBETWEEN(min,max), for example =RANDBETWEEN(1,100). Both endpoints can appear.
Can I stop the random numbers from recalculating?
Two ways. Paste them as values to replace the formulas permanently, or switch the file to manual recalculation so nothing updates until you ask it to.
Is RAND truly random?
No. It is pseudorandom, generated by an algorithm that spreads results evenly. That is fine for games, sampling and shuffling, but it is not suitable for cryptography or anything security-sensitive.
Can I generate a random date?
Yes. Use =RANDBETWEEN(DATE(2026,1,1),DATE(2026,12,31)) and format the cell as a date. The result is a serial number that displays as a calendar date.
Why does my random pick repeat the same name twice?
Each RAND result is independent, so duplicates are expected. Sort a helper column of random numbers and take the top rows, or remove picked names from the pool, if you need unique winners.