Excel Randomize List of Names: 10 Reliable Methods

How-to basics · Updated November 19, 2026

To quickly randomize names in Excel, add a helper column with =RAND(), fill it down beside the names, then sort the whole list by that column. This guide covers that simple approach alongside dynamic-array formulas, random draws, filtered lists, Power Query, and a VBA option, so you can choose a method suited to your Excel version and whether you need a one-time shuffle or a repeatable process.

1. Add a RAND Helper Column and Sort

With names in A2:A20, enter =RAND() in B2 and fill it down through B20; each row receives a random decimal, such as 0.183 or 0.742. Select both columns, then use Data > Sort and sort by column B, smallest to largest, so the names move with their random keys rather than becoming detached from them. This works in older Excel versions as well as Microsoft 365, and it is easy to inspect, but recalculation can change the keys, so copy the shuffled names and use Home > Paste > Paste Values if you need to keep a particular draw.

2. Shuffle a List with SORTBY and RANDARRAY

With names in A2:A20 and an empty output area below or beside the source, enter =SORTBY(A2:A20,RANDARRAY(ROWS(A2:A20))) in the first output cell. The formula spills a reordered copy of the names without helper cells; one possible result is a different ordering of the same 19 entries, and the source list remains untouched. SORTBY and RANDARRAY are available in Microsoft 365 and Excel 2021 or later, and the result can change when Excel recalculates, so use Paste Values to preserve a shuffle you intend to share or print.

3. Select a Random Sample Without Repeats

With 19 names in A2:A20 and a requirement to draw five distinct entries, put this formula in an empty cell: =INDEX(SORTBY(A2:A20,RANDARRAY(ROWS(A2:A20))),SEQUENCE(5)). It randomizes the full list internally and returns its first five names, so the same person cannot appear twice unless the source list itself contains duplicate names; a possible result is five different entries from the 19-name roster. This is useful for selecting interviewees, classroom volunteers, or a small audit sample, and it needs Microsoft 365 or Excel 2021 or later because it uses SORTBY, RANDARRAY, and SEQUENCE.

4. Draw One Random Winner

With eligible names in A2:A20, enter =INDEX(A2:A20,RANDBETWEEN(1,ROWS(A2:A20))) in a result cell to return one entry, such as the name in the seventh position for a particular calculation. RANDBETWEEN chooses an integer from 1 through the number of rows, and INDEX returns the name at that position; the entries therefore have equal chances when each person appears once. The formula is a compact option for a raffle or a quick turn-taking decision, but it can return a different winner after recalculation and treats duplicated names as extra chances.

5. Randomize Complete Rows, Not Just Names

With names in A2:A20 and each person’s department and email in columns B and C, enter =SORTBY(A2:C20,RANDARRAY(ROWS(A2:A20))) in an empty area. Excel returns the entire row in a randomized order, keeping every name attached to its own department and email; for example, a person who was on row 8 stays paired with the details from row 8 after shuffling. This is safer than sorting the name column alone when the list contains related information, and it requires Microsoft 365 or Excel 2021 or later; make sure the spill destination is blank and outside the source range.

6. Shuffle Names Within Each Group

With department labels in A2:A20 and names in B2:B20, enter =SORTBY(A2:B20,A2:A20,1,RANDARRAY(ROWS(A2:A20))) in an empty area. The formula first sorts departments in ascending order and then uses a random key to reorder rows within each department, leaving the groups intact while changing the order of people inside them. This is handy for rotating speaking order separately by class, location, or team, but it does not randomize the order of the groups themselves; it requires Microsoft 365 or Excel 2021 or later and recalculates like other random formulas.

7. Randomize Only Eligible Names

With names in A2:A20, eligibility labels in B2:B20, and the exact label Eligible for people who can be selected, enter =SORTBY(FILTER(A2:A20,B2:B20="Eligible"),RANDARRAY(ROWS(FILTER(A2:A20,B2:B20="Eligible")))) in an empty cell. FILTER excludes rows marked otherwise, and SORTBY randomizes only the remaining names, so you can keep the full roster intact while drawing from a current subset. This is useful for opt-in prize draws or assigning only available staff, but the label must match exactly and an empty eligible set produces a calculation error; FILTER, SORTBY, and RANDARRAY require Microsoft 365 or Excel 2021 or later.

8. Freeze a Shuffle So It Stays the Same

After using a RAND helper column or a SORTBY formula to produce the order you want, select the shuffled output and copy it, then choose Home > Paste > Paste Values in a separate range or over the output. That replaces changing formulas with fixed text values, so pressing F9 or editing another cell will not quietly change a published draw; in Excel for Mac, use Home > Paste > Values, with the exact paste options depending on the ribbon layout. Keep the original roster on another sheet if you need an audit trail, and record the date and selection rules when the result matters to a group.

9. Use Power Query for a Refreshable Shuffle

Turn the name list into a table, select a cell in it, and choose Data > From Table/Range to open Power Query Editor; then choose Add Column > Custom Column and enter Number.Random() as the custom-column formula. Sort the new random-number column, remove that helper column if it should not appear in the output, and choose Home > Close & Load; the loaded query gives you a shuffled table while leaving the original source data available. Refreshing the query creates a new randomized order, which suits recurring lists, though Power Query is more setup than a one-off formula and the exact ribbon labels can vary slightly in Excel for Mac or the web.

10. Shuffle Names in Place with VBA

For a one-click in-place shuffle of names in A2:A20, open the Visual Basic editor with Alt+F11 on Windows, insert a standard module, and add this macro; it uses the Fisher–Yates method to swap each item with a randomly selected earlier position.

Sub ShuffleNames()
    Dim names As Variant
    Dim i As Long
    Dim j As Long
    Dim temp As Variant

    names = ActiveSheet.Range("A2:A20").Value
    Randomize

    ' Swap each entry with a randomly chosen earlier entry.
    For i = UBound(names, 1) To 2 Step -1
        j = Int(Rnd * i) + 1
        temp = names(i, 1)
        names(i, 1) = names(j, 1)
        names(j, 1) = temp
    Next i

    ActiveSheet.Range("A2:A20").Value = names
End Sub

Run it from the Macros dialog after confirming the active sheet contains the intended range; on Mac, open the editor with Option+F11 or use Tools > Macro > Visual Basic Editor, depending on keyboard settings. Save a copy of the workbook before running the macro because VBA changes cannot be undone with Ctrl+Z, and save the working file as an Excel Macro-Enabled Workbook (.xlsm) to retain the code.

How to Choose

Start with the outcome you need: one winner, a fixed-size sample, a full shuffled roster, or a new order that preserves each person’s accompanying data. For one-off work in almost any Excel version, the RAND helper-column method is straightforward and visible; for a clean formula result without helper columns, use SORTBY with RANDARRAY if your Excel version supports dynamic arrays. Choose the sample formula when repeats are not allowed, and use the filtered version when eligibility depends on a status column.

Next, decide whether the order should change. RAND, RANDBETWEEN, and RANDARRAY are volatile: a recalculation can produce another result, so freeze a draw with Paste Values before distributing it. Power Query is preferable when the shuffle is part of a refreshable data process, while VBA is appropriate when you want a button-driven shuffle and are comfortable enabling macros. If names have associated details, always shuffle complete rows or sort a whole table; sorting names by themselves can corrupt the pairings. Finally, check for duplicate names, blank cells, and the exact number of eligible entries before treating a random result as final.

Frequently Asked Questions

How do I randomize a list of names in Excel without duplicates?

Use SORTBY with RANDARRAY to reorder the full list, or use the sample formula with SEQUENCE to return a chosen number of distinct rows. Duplicate source entries remain duplicates, so remove accidental repeats first if each person should have one chance.

Why does my randomized order keep changing?

Random functions recalculate when Excel recalculates the workbook, including after some edits or when you press F9. Copy the finished output and choose Paste Values to lock the current order.

Can Excel pick a random name without VBA?

Yes. INDEX with RANDBETWEEN returns one name, and a RAND helper column can shuffle a whole list without macros. Both options work in older desktop versions of Excel.

Does sorting by RAND keep names with their other details?

Only if you select the entire data range or table when sorting. For a formula-based shuffle, sort the full row range with SORTBY, rather than returning only the name column.

Can I use the dynamic-array formulas in older Excel?

SORTBY, RANDARRAY, FILTER, and SEQUENCE require Microsoft 365 or Excel 2021 or later. In older versions, add RAND beside each name, fill it down, and sort the complete list by that helper column.

Final Thoughts

For most lists, a RAND helper column is the simplest dependable shuffle, while SORTBY and RANDARRAY make a quick, formula-driven alternative in current Excel. Use a sample or winner formula when you need only a selection, keep entire rows together when details matter, and paste values whenever the draw must stay fixed.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.