Cellwise Try it free

Excel guide · 4 min read

Pick random names in Excel without duplicates

Quick answerPut =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.

ABCD
1EntrantRandom numberWinners to pick
2Priya Shah0.418373
3Marcus Lee0.90214
4Elena Rossi0.15602
5Tom Becker0.77391
6Aisha Khan0.06348
7Ben Carter0.5812
8Yuki Tanaka0.84677
9Priya Shah0.29955
10Leo Martin0.66503
11Nora Walsh0.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.

  1. In B2, type =RAND() and fill it down to the last entrant (B11 here).
  2. With B2:B11 still selected, copy it (Ctrl+C).
  3. 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.

=INDEX(A2:A11,MATCH(LARGE(B2:B11,1),B2:B11,0))

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.

=SORT(FILTER(A2:B11,B2:B11>=LARGE(B2:B11,D2)),2,-1)

Result: spills 3 rows × 2 columns

Marcus Lee0.90214
Yuki Tanaka0.84677
Tom Becker0.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.

=COUNTIF($B$2:$B$11,">"&B2)+1

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.

=COUNTA(A2:A11)-COUNTA(UNIQUE(A2:A11))

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

Related guides

Updated