To shuffle names in Microsoft Excel for Microsoft 365, add a random-number helper with =RAND() and sort the names by that helper, or use =SORTBY(A2:A20,RANDARRAY(ROWS(A2:A20))) for a live shuffled list. The methods below cover quick manual sorting, dynamic formulas, random draws and samples, Power Query, and VBA, so teachers, event organizers, team leads, and anyone managing a list can choose an approach that fits.
1. Add a RAND helper column and sort
This is the straightforward option when you want to see and control the shuffle process. With names in A2:A20 and a helper column in B, enter =RAND() in B2 and fill it down, then select the names and helper values and choose Data > Sort to sort by column B; each name receives a random decimal key between 0 and 1. Sorting the complete range keeps each key attached to its name, and you can delete the helper column after the sort if you no longer need it. RAND recalculates, so the order can change after workbook calculations; copy the results and use Paste Special > Values if you need to keep the current order.
2. Create a live shuffled list with SORTBY
A dynamic-array formula can return a shuffled copy without altering the source list. With names in A2:A20, enter =SORTBY(A2:A20,RANDARRAY(ROWS(A2:A20))) in an empty cell; Excel spills the reordered names into the cells below. SORTBY sorts the source range by a same-sized set of random keys, while ROWS counts how many keys RANDARRAY must generate, so the formula adjusts if you change the referenced range. This option requires Microsoft 365 or Excel 2021 and needs clear cells beneath the formula for its spill results; a blocked spill area produces a #SPILL! error.
3. Shuffle complete rows so details stay with each name
If each person has related information—such as a department, email address, or assigned team—shuffle the entire record rather than the name column alone. With records in A1:D20 and headers in row 1, put =RAND() in E2, fill it through E20, then select A1:E20 and use Data > Sort to sort by column E, choosing to expand the selection if Excel prompts you. The random helper is attached to each row during sorting, preserving the relationship between every name and its other fields. Do not sort only column A, because that would separate names from their corresponding details.
4. Freeze a shuffled order as fixed values
Any formula-based shuffle can recalculate, which is useful for generating new orders but inconvenient for a published draw or printed sign-up sheet. Once the shuffled results appear, select and copy them, then use Home > Paste > Paste Values to replace the formulas with their displayed names; the current sequence will no longer change when Excel recalculates. In Excel for Microsoft 365 on Windows, Ctrl+C copies and Ctrl+Alt+V opens the Paste Special dialog, where you can choose Values; on Mac, use Command+C and choose Paste Special from the Edit menu or the Home ribbon. Keep the original names in a separate range before replacing anything, so you can generate another shuffle later.
5. Pick one random name from the list
When the goal is a winner or a person to call next—not a reordered list—return just one name from the shuffled results. With names in A2:A20 and an empty result cell, enter =INDEX(SORTBY(A2:A20,RANDARRAY(ROWS(A2:A20))),1); INDEX returns the first entry in a newly randomized ordering. Each recalculation can select a different name, so copy the displayed result and paste it as a value as soon as you need to record the draw. This formula treats every row as one entry, meaning a person listed twice has twice the chance of being selected; remove accidental duplicates first if each person should have equal odds.
6. Return a random sample without manually sorting
For a short list of volunteers, speakers, or participants selected from a larger roster, use TAKE to return the first few entries of a randomized order. With names in A2:A20, enter =TAKE(SORTBY(A2:A20,RANDARRAY(ROWS(A2:A20))),5) in an empty cell to spill five names. This takes a sample without replacement within that result: each source row can appear only once in the five-name output, although duplicate names already present in the source remain separate entries. TAKE is available in Microsoft 365 and Excel 2024; change the final 5 to the number of names needed, and make sure the spill area is clear.
7. Shuffle position numbers instead of the source names
Sometimes other formulas refer to the original list, so changing its order is undesirable; a shuffled sequence of position numbers can provide a separate randomized index. With names in A2:A20, enter =SORTBY(SEQUENCE(ROWS(A2:A20)),RANDARRAY(ROWS(A2:A20))) in an empty cell to return a random ordering of the numbers 1 through 19. Those positions correspond to A2 through A20, so position 1 points to A2 and position 19 points to A20; you can use the sequence for a draw order while leaving the roster untouched. SEQUENCE, SORTBY, and RANDARRAY are available in Microsoft 365 and Excel 2021 or later, and the resulting order will recalculate unless you paste it as values.
8. Shuffle only names that meet a condition
When only some people are eligible—for example, those marked Yes in an entry column—combine FILTER with SORTBY so the others never enter the randomized output. With names in A2:A20, eligibility markers in B2:B20, and an empty output area, enter =SORTBY(FILTER(A2:A20,B2:B20="Yes"),RANDARRAY(COUNTIF(B2:B20,"Yes"))). FILTER keeps rows marked Yes, COUNTIF supplies the matching number of random keys, and SORTBY returns those eligible names in random order. This formula uses Microsoft 365 or Excel 2021 functions; if no cell says Yes, FILTER returns a no-results error unless you add its optional if-empty argument, so check the eligibility column before relying on the output.
9. Shuffle a table with Power Query
Power Query is useful when a list comes from a recurring import and you prefer a refreshable set of transformation steps over worksheet formulas. Convert the source range to a table, select a cell in it, and choose Data > From Table/Range; in the Power Query Editor, use Add Column > Custom Column and enter Number.Random() as the custom-column formula. Sort the new column ascending, remove that helper column, then choose Home > Close & Load to return the shuffled table to Excel. Refreshing the query can generate another random order, so copy the loaded results as values if the sequence must remain fixed; this method is especially practical for tables with several fields because the rows stay intact.
10. Shuffle names in place with a VBA macro
A VBA macro can apply the Fisher–Yates shuffle directly to a contiguous list in column A, with a header in A1, instead of relying on a sort column. Press Alt+F11 on Windows, choose Insert > Module, and paste the code below; on Mac, open the Visual Basic Editor from the Developer tab or Tools > Macro > Visual Basic Editor, since keyboard access can vary by keyboard settings. The loop selects a random remaining row and swaps it with the current row, giving each possible ordering an equal chance when the random generator is used properly.
Sub ShuffleNames()
Dim ws As Worksheet
Dim lastRow As Long
Dim i As Long
Dim j As Long
Dim temp As Variant
Set ws = ActiveSheet
lastRow = ws.Cells(ws.Rows.Count, "A").End(xlUp).Row
If lastRow < 3 Then Exit Sub
Randomize
For i = lastRow To 3 Step -1
j = Int((i - 1) * Rnd) + 2 ' Choose a row from 2 through i.
temp = ws.Cells(i, "A").Value
ws.Cells(i, "A").Value = ws.Cells(j, "A").Value
ws.Cells(j, "A").Value = temp
Next i
End Sub
This macro assumes the names occupy every row from A2 to the last used cell in column A, so remove blank gaps and confirm the active worksheet before running it. Save a copy of the workbook first, and save the macro-enabled file as .xlsm; macros cannot be undone with Ctrl+Z, and this one changes the source order directly.
How to Choose
Start with whether you want to change the original list. For a one-off reorder that you can inspect, the RAND helper and Data > Sort are easy to audit; for a separate, automatically updating result, SORTBY with RANDARRAY is faster and leaves the source alone. If names have associated details, sort the complete rows, not just the name field. If a result needs to remain stable, paste values after generating it or use a method such as Power Query and preserve a copy of its output.
Next consider the task: use the single-name formula for one winner, TAKE for a small sample, or FILTER when eligibility rules exclude some names. Check duplicates before drawing, because formulas treat each row as an entry rather than automatically treating identical text as one person. Version matters too: dynamic-array formulas such as SORTBY, RANDARRAY, FILTER, SEQUENCE, and TAKE require Microsoft 365 or a recent Excel release such as Excel 2021 or 2024, while helper-column sorting works in older versions as well. Choose VBA only when changing the source list in place is helpful and macros are permitted in your organization.
Frequently Asked Questions
Why does my shuffled list keep changing?
RAND and RANDARRAY are volatile random functions, so Excel can recalculate them after edits or other calculation events. Copy the displayed order and paste values to keep one shuffle, or set up a manual calculation workflow if you understand the effects on other workbook formulas.
Can Excel shuffle names without repeating anyone?
Yes, if each person appears once in the source range, SORTBY with RANDARRAY creates an ordering in which each source row appears once. If the source contains duplicate entries for one person, those entries are still treated as separate rows, so deduplicate first when each person should appear only once.
How do I keep each name matched to its department or email?
Add a random helper to the record and sort the complete table by that helper. Make sure Excel sorts the entire selected range, not the name column alone; otherwise the related fields can become attached to the wrong person.
Does the shuffle formula work in older Excel versions?
The SORTBY and RANDARRAY formula requires Microsoft 365 or Excel 2021 and later. In older versions, enter RAND in a helper column, fill it down, and sort the full list or table by the helper values.
How do I draw a fair winner from a list?
Use one row per eligible entry, then select a name with the single-name formula or shuffle and take the first name. Check the eligibility and duplicate-entry rules before drawing, and paste the selected name as a value so recalculation does not change the recorded result.
Final Thoughts
For most everyday lists, a RAND helper and a full-range sort offer the clearest manual shuffle, while SORTBY and RANDARRAY produce a convenient formula-driven result. Pick the method that matches your Excel version and whether the order must be temporary, filtered, or fixed, then preserve the final names as values whenever the sequence matters.
Related
- Excel RANK.AVG vs RANK.EQ: Which Should You Use?
- Excel Rank Ties Without Skipping Numbers
- Excel Randomize List of Names: 10 Reliable Methods
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Best Way to Export Outlook Contacts as CSV or PSTFor most people, the best way to export Outlook contacts is to save them as a CSV file:…
- Build an Enum from Excel Data: Practical Guide and ChecksYes. You can use Excel as the source for an enum by keeping each permitted name and its…
- Percentage Difference Formula in Google SheetsIn Google Sheets, percentage difference is the absolute difference between two values divided by their average. If A2…
- Excel File Format or File Extension Corrupted? What to DoIf Excel reports that a file format or file extension is not valid, the extension may not match…
- Excel Named Range: How to Create OneTo create a named range in Excel, select the cells, type a clear name in the Name Box…
- How to Animate in Microsoft PowerPoint: A Practical GuideTo animate in Microsoft PowerPoint, select text or an object, open the Animations tab, choose an effect, then…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.