Excel guide · 4 min read
Pick random names in Excel without duplicates
=RAND() next to each name, freeze the numbers with Paste Values, then take the names with the largest numbers: =INDEX(A2:A11,MATCH(LARGE(B2:B11,1),B2:B11,0)) gives the first winner, LARGE(...,2) the second, and so on. Every row has its own random number, so no one can be drawn twice.Sample data
Every result on this page was calculated from this sheet by the same spreadsheet engine the Cellwise app uses.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Entrant | Random number | Winners to pick | |
| 2 | Priya Shah | 0.41837 | 3 | |
| 3 | Marcus Lee | 0.90214 | ||
| 4 | Elena Rossi | 0.15602 | ||
| 5 | Tom Becker | 0.77391 | ||
| 6 | Aisha Khan | 0.06348 | ||
| 7 | Ben Carter | 0.5812 | ||
| 8 | Yuki Tanaka | 0.84677 | ||
| 9 | Priya Shah | 0.29955 | ||
| 10 | Leo Martin | 0.66503 | ||
| 11 | Nora Walsh | 0.37419 |
Download this sheet as an Excel practice file (.xlsx)
Step 1: give every entrant a random number
RAND() returns a random decimal from 0 up to (but not including) 1. Give each row its own number and the order of those numbers is a fair shuffle of the list. Picking by rank, not by position, is what stops repeats.
RAND recalculates every time anything on the workbook changes, and every time you press F9. Freeze the numbers before you announce a winner, or the result changes the moment someone types in a cell. Keep the frozen sheet as your record of the draw.
- In B2, type
=RAND()and fill it down to the last entrant (B11 here). - With B2:B11 still selected, copy it (Ctrl+C).
- Paste back as values: Home > Paste > Paste Values, or Ctrl+Alt+V, then V and Enter on Windows. The formulas become fixed numbers, like the ones in this sheet.
Step 2: pull the winners with INDEX, MATCH and LARGE
LARGE(B2:B11,1) finds the largest random number, MATCH finds which row it is in, and INDEX returns the name on that row. Change the 1 to 2 and 3 for the second and third winners, or reference a cell with 1, 2, 3 in it and fill down.
This works in every version of Excel. Ties between RAND values are so unlikely that you can ignore them in practice.
Result: Marcus Lee
Marcus Lee wins first place with 0.90214. LARGE(...,2) gives Yuki Tanaka and LARGE(...,3) gives Tom Becker.
All the winners in one formula (Excel 365 and 2021)
FILTER keeps the rows whose random number is at least the Nth largest, where N is the number of winners in D2. SORT then puts them in draw order, highest number first. Change D2 to 5 and the list grows to five names.
Without SORT, FILTER returns the winners in the order they appear on the list, which is fine for a sample but not for first, second and third prize.
Result: spills 3 rows × 2 columns
| Marcus Lee | 0.90214 |
| Yuki Tanaka | 0.84677 |
| Tom Becker | 0.77391 |
Marcus Lee, Yuki Tanaka and Tom Becker, each next to their random number, in prize order.
Show each entrant's draw position
For a ranked list instead of a few winners, count how many random numbers are bigger than the row's own and add 1. Fill it down column C to number every entrant from 1 to 10. RANK.EQ(B2,$B$2:$B$11) gives the same answer.
This is also how you split a list into random groups: positions 1 to 5 are team A, 6 to 10 are team B.
Result: 6
6: Priya Shah's first entry comes sixth in the draw.
The same person entered twice
"Without duplicates" has two meanings. The methods above never pick the same row twice. But if one person is on the list twice, they have two chances and can win twice. Priya Shah appears in rows 2 and 9 here.
Check before the draw: compare the row count with the number of unique names. If they differ, remove the extra entries with Data > Remove Duplicates, or build a clean list with =UNIQUE(A2:A11), then add the random numbers next to that list.
Result: 1
1: one name is a repeat, so there are 10 entries but only 9 people.
The Excel 365 shortcut and why RANDBETWEEN repeats
In Excel 365 and Excel 2024 you can shuffle and take the top N in one cell with no helper column: =TAKE(SORTBY(A2:A11,RANDARRAY(ROWS(A2:A11))),3). In Excel 2021, which has no TAKE, use =INDEX(SORTBY(A2:A11,RANDARRAY(ROWS(A2:A11))),SEQUENCE(3)). Both recalculate like RAND, so copy the result and paste it as values to keep it.
Avoid =INDEX(A2:A11,RANDBETWEEN(1,10)) copied into three cells. Each cell rolls its own number between 1 and 10, so two cells can easily land on the same row. With 3 picks from 10 names, that happens more than a quarter of the time.
Common mistakes
The winners change every time you edit the sheet
RAND, RANDBETWEEN and RANDARRAY are volatile. Copy the random numbers (or the result) and use Paste Values to freeze them.
The same name drawn twice
Use one random number per row and pick by rank (LARGE or SORTBY), not separate RANDBETWEEN calls.
Someone has two entries
Remove duplicate names first with Data > Remove Duplicates or UNIQUE, then draw.
Sorting the list by a live RAND column
The sort works, but RAND recalculates straight after it, so the numbers no longer match the new order. Freeze the numbers first.
FAQ
How do I randomly select names in Excel without repeats?
Add =RAND() next to each name, freeze it with Paste Values, then use =INDEX(names,MATCH(LARGE(rand,k),rand,0)) for k = 1, 2, 3. Each row has one number, so no row is picked twice.
How do I stop RAND from changing in Excel?
Copy the cells with RAND and paste them back with Home > Paste > Paste Values. They become ordinary numbers that never recalculate.
How do I shuffle a list in Excel?
Put =RAND() in the next column, then sort both columns by the random column with Data > Sort. In Excel 365 or 2021, =SORTBY(A2:A11,RANDARRAY(ROWS(A2:A11))) returns a shuffled copy in one formula.
Is the RAND function random enough for a prize draw?
It is fine for an office raffle or picking a sample. Freeze the numbers and keep the sheet so anyone can see how the winners were chosen. If your draw has official rules, follow those rules for how it must be run.
Functions used
INDEXValue at a positionMATCHPosition of a valueLARGEk-th largestFILTERKeeps matching rows, spillsSORTSorts a range, spillsCOUNTIFCounts cells that matchCOUNTACounts non-empty cellsUNIQUERemoves duplicates, spills
Related guides
- How to rank numbers in Excel
- How to find the top 5 values in Excel
- How to remove duplicates in Excel
- How to create a unique list in Excel
- How to sort data with a formula in Excel
- Excel formulas cheat sheet: the 25 everyone should know
- Running count of occurrences in Excel
Updated