How to Pick a Random Name in Excel or Google Sheets
To pick a random name in Excel or Google Sheets, put the names in column A and use =INDEX(A2:A31,RANDBETWEEN(1,COUNTA(A2:A31))). It works in every version of Excel and in Google Sheets. Below are copy-paste formulas for picking one name, several names with no repeats, shuffling a whole list and weighted picks, plus the one thing most guides skip: how to stop the winner changing every time the sheet recalculates.
The Quick Answer
| You want to… | Excel | Google Sheets |
|---|---|---|
| Pick 1 name (any version) | =INDEX(A2:A31,RANDBETWEEN(1,COUNTA(A2:A31))) | Same formula |
| Pick 3 names, no repeats | =TAKE(SORTBY(A2:A31,RANDARRAY(ROWS(A2:A31))),3) | =ARRAY_CONSTRAIN(SORT(A2:A31,RANDARRAY(ROWS(A2:A31)),TRUE),3,1) |
| Shuffle the whole list | =SORTBY(A2:A31,RANDARRAY(ROWS(A2:A31))) | =SORT(A2:A31,RANDARRAY(ROWS(A2:A31)),TRUE) |
| Shuffle in place, no formula | Use a helper column (below) | Right-click › Randomize range |
Change A2:A31 to your own range, and change 3 to the number of names you need.
How to Pick One Random Name in Excel
- Put one name in each cell of column A, starting in A2, with a heading such as “Name” in A1.
- Click an empty cell, such as C2.
- Type
=INDEX(A2:A31,RANDBETWEEN(1,COUNTA(A2:A31)))and press Enter.
COUNTA counts the names, RANDBETWEEN picks a random position from 1 to that count, and INDEX returns the name in that position. Press F9 to pick again.
Make sure there are no blank cells in the middle of the list. COUNTA counts only filled cells, so a gap shifts the range and the last name can be missed.
How to Pick Several Names With No Repeats
Excel for Microsoft 365
=TAKE(SORTBY(A2:A31,RANDARRAY(ROWS(A2:A31))),3)
This shuffles the whole list into a random order with SORTBY and RANDARRAY, then TAKE keeps the first 3. Because it shuffles rather than picking positions, no name can come up twice. It spills into the cells below, so leave them empty.
Older versions of Excel
If your Excel doesn’t have SORTBY or TAKE, use a helper column:
- In B2, type
=RAND()and fill it down next to every name. - In D2, type
=INDEX($A$2:$A$31,RANK(B2,$B$2:$B$31)). - Fill D2 down as many rows as you need names. Each row gives a different name.
Google Sheets
=ARRAY_CONSTRAIN(SORT(A2:A31,RANDARRAY(ROWS(A2:A31)),TRUE),3,1)
SORT orders the names by a column of random numbers, and ARRAY_CONSTRAIN keeps the first 3 rows. If your column has empty cells at the end, use FILTER to skip them:
=ARRAY_CONSTRAIN(SORT(FILTER(A2:A,A2:A<>""),RANDARRAY(COUNTA(A2:A)),TRUE),3,1)
How to Shuffle a List of Names
- Excel 365:
=SORTBY(A2:A31,RANDARRAY(ROWS(A2:A31)))gives the whole list in a random order. Use it for presentation order or random groups. - Any Excel: add
=RAND()next to each name, select both columns and sort by the random column. - Google Sheets: select the names, right-click and choose Randomize range (it may be under “View more cell actions”). This shuffles the cells themselves, with no formula.
Weighted Picks: More Entries, More Chances
If some people should have more chances, such as raffle tickets, put names in column A and their number of entries in column B. Then:
- In C2, type
=SUM($B$1:B1)and fill down. This is the running total of entries before each row, so C2 is 0. - Pick a winner with
=INDEX(A2:A31,MATCH(RAND()*SUM(B2:B31),C2:C31,1)).
A random number between 0 and the total number of entries lands inside one person’s block of entries, so someone with 5 entries has 5 times the chance of someone with 1. This works in Excel and Google Sheets. We checked the method with 250,000 simulated draws, and every person won in proportion to their entries.
Prefer not to build it? Paste the names and counts, like Anna 5, into our raffle generator, which numbers the tickets and draws prizes in order.
Stop the Winner Changing: Freeze Your Result
RAND, RANDBETWEEN and RANDARRAY are volatile: they recalculate every time you edit the sheet, open it, or press F9. That means the name you announced can change the moment someone types in another cell.
- Freeze it: select the result, copy, then use Paste Special › Values (Excel) or Paste special › Values only (Google Sheets).
- Record it: take a screenshot or screen recording before you freeze the result, so others can see the draw.
- Turn off automatic calculation in Excel (Formulas › Calculation Options › Manual) if you need the sheet to sit still while you work.
Is Excel or Google Sheets Random Enough?
For picking a name in class or at work, yes. Excel has used the Mersenne Twister algorithm for RAND since Excel 2010, which is a well-tested pseudo-random generator. It isn’t designed for security, and a spreadsheet keeps no record of the draw, so it’s weak as proof for a public giveaway.
For a prize draw that others must trust, paste the column into an online picker that draws with a cryptographically secure generator and creates a record. Our giveaway picker removes duplicates, draws winners and backups, and gives a list fingerprint that entrants can check on the draw checker.
Or Paste the Column Into a Wheel
- Select the names in your sheet and copy them.
- Paste them into the random name picker. Each cell becomes one name.
- Turn on “Remove winner after each spin” for no repeats, and press Full screen to spin in front of the room.
Common Mistakes
- Including the heading row in the range, so “Name” can be picked.
- Blank cells in the middle of the list, which shift
COUNTA. - Announcing a winner, then editing the sheet so it recalculates.
- Picking several names with
RANDBETWEENin several cells, which can give the same name twice. - Pressing F9 until a favourite name comes up.
Frequently Asked Questions
How do I randomly pick names in Excel?
Use =INDEX(A2:A31,RANDBETWEEN(1,COUNTA(A2:A31))) for one name. For several names with no repeats in Excel 365, use =TAKE(SORTBY(A2:A31,RANDARRAY(ROWS(A2:A31))),3).
How can I randomly shuffle a list of names in Excel?
In Excel 365 use =SORTBY(A2:A31,RANDARRAY(ROWS(A2:A31))). In older versions, add =RAND() next to each name and sort both columns by that random column.
How do I get Excel to pick a random cell from a list?
INDEX with RANDBETWEEN returns the value of a random cell in the range. Press F9 for a new pick.
How do I make a random name picker in Google Sheets?
Use the same INDEX and RANDBETWEEN formula for one name, or SORT with RANDARRAY inside ARRAY_CONSTRAIN for several. To shuffle the cells themselves, right-click and choose Randomize range.
Why does my random name keep changing?
Random functions recalculate whenever the sheet changes. Copy the result and paste it as values to keep it.
Can each person only win once?
Yes, if you shuffle and take the first names, as with SORTBY or SORT. Picking with RANDBETWEEN in several cells can repeat a name.
