Can You Shuffle Names in Excel? Methods and Examples

How-to basics · Updated November 19, 2026

Yes. In Excel for Microsoft 365 on Windows, add a random number beside each name and sort the full list by that helper column; in Microsoft 365, a formula can also return a shuffled list without rearranging the source. The helper-column approach works across more Excel versions and is a practical choice when names belong to other row data.

What shuffling names in Excel means

Shuffling changes the order of a list randomly, usually without adding or removing any names. If the starting list is Ana, Ben, and Chris, a shuffle might show Chris, Ana, Ben. Each person still appears once. This is different from selecting a random name, which returns one choice, and from sampling a group, which returns a smaller selection from the list.

Excel does not have a dedicated Shuffle button for a worksheet range. Instead, you can generate random values and use them to determine a new order. This is useful for assigning presentation order, mixing a classroom roster, choosing a sequence for a game, or reducing the effect of a fixed alphabetical order. The results are random in the ordinary spreadsheet sense, not a guarantee of fairness for high-stakes decisions.

Shuffle a list with a RAND helper column

The helper-column method is easy to inspect and works in many Excel versions. It creates one random value per row, then sorts the names according to those values. For example, suppose the names are in A2:A20 and column B is empty. In B2, enter this formula:

With names in A2:A20, enter this in B2 and fill it down through B20: =RAND()

  1. Type a heading such as Random in B1, if you want to label the helper column.
  2. Enter the formula in B2 and fill it down through the last name. You can drag the fill handle or copy the formula into the remaining cells.
  3. Select the complete range containing the names and helper values, such as A1:B20.
  4. Choose Data > Sort. Sort by the Random column, using Smallest to Largest or Largest to Smallest. Either direction gives a randomized order.
  5. When Excel asks whether to expand the selection, choose the option that keeps the related columns together. Check that each name remains beside its own row information.

RAND returns a decimal value greater than or equal to 0 and less than 1. The exact values are not important; the sort order is. A formula in B2 copied down is recalculated separately in each row, so the helper values will generally differ. If two values happen to match, Excel may leave those tied entries in their prior relative order, but ties are uncommon in a list of ordinary size.

Use a dynamic formula in Microsoft 365

If you want a shuffled result in a separate area and do not want to sort the original list, Microsoft 365 has a compact option. With names in A2:A20 and no blank cells in that range, enter this formula in an empty cell outside the source list:

With the source names in A2:A20, enter: =SORTBY(A2:A20,RANDARRAY(ROWS(A2:A20)))

The result spills into the cells below the formula. SORTBY orders the source range using the random array returned by RANDARRAY; ROWS makes the array the same height as the list. Keep the spill area clear, or Excel will show a #SPILL! error because it cannot place the results. This formula requires Microsoft 365; it is not available in every older perpetual Excel edition.

The formula leaves the source names where they are, which is helpful when you want to compare the shuffled order with the original or create a randomized display elsewhere. It is still a live formula: recalculation can produce a different sequence. If the source range contains blanks, those blanks are also part of the range being shuffled. Use a range that contains just the intended names, or clean the source list first.

Keep names connected to their row data

A common mistake is sorting only the names column when each person has related information in other columns. Imagine a table with a name, team, and email address. Sorting column A alone can detach a name from the corresponding team and email, creating incorrect records. Select the entire data range before sorting, or convert the range to an Excel table and sort by the helper column while keeping each record intact.

For a table with headings in row 1, include all relevant columns and the helper column in the selection. If Excel displays a warning about expanding the selection, expanding is normally the right choice when the adjacent cells are part of the same records. If the list is already an Excel table, add a helper column inside the table, fill it with RAND values, and sort the table by that column. Do not include unrelated data elsewhere on the sheet just because it is nearby.

Before sorting, check for merged cells, completely blank rows, and multiple separate lists in the selected area. These can make sorting confusing or prevent it. If the workbook is important, save a copy first; sorting changes the arrangement of the selected records, even though it does not delete them.

Make the shuffled order stay fixed

RAND and RANDARRAY are volatile functions: Excel recalculates them when the workbook recalculates. As a result, a shuffled order can change after an edit or another recalculation. Press F9 on Windows to recalculate formulas and generate a fresh order. On a Mac, F9 may require the Fn key depending on the keyboard settings. Recalculation behavior can also depend on the workbook’s calculation settings.

If you need to keep one particular shuffle, preserve the result as values. With the helper-column method, sort the list, then copy the sorted name-and-record range and use Home > Paste > Paste Values in an appropriate destination. With a dynamic formula, copy the spilled results and paste values into a separate range. The pasted values no longer depend on RAND, so later recalculations will not reshuffle them. Keep the original list or a backup if you may need to return to it.

Another option is to copy the current random helper numbers and paste them as values before sorting. That stops the helper numbers from changing, and the resulting sort order stays consistent unless you change the data or sort again. Pasting values is especially useful when the shuffled order is being shared or used as a record of an assignment.

Shuffle the list or choose a random subset?

Shuffling reorders every item; a random subset selects only some items. For example, shuffling 20 names gives a new ordering of all 20, while selecting five people gives a group of five. A useful way to take a subset without duplicates is to shuffle the whole list and use the first few results. With the dynamic formula, read the first five spilled names; with the helper method, sort all rows and take the first five.

This distinction matters because repeatedly drawing one random name with a single-cell formula can select the same person more than once. That may be suitable for independent draws where repeats are allowed, but it is not equivalent to drawing several distinct names from a hat. For a no-repeat selection, use one shuffled list and take the required number of entries.

Common problems and practical limits

  • The order changes unexpectedly: RAND-based formulas recalculate. Paste the result as values when you need a stable order.
  • The names no longer match their details: The sort selection probably excluded related columns. Sort the complete records together.
  • The dynamic formula shows #SPILL!: Clear cells below the formula where the returned list needs to appear, and check for merged cells in the spill area.
  • Blank entries appear in the shuffle: The selected source range includes blank cells. Narrow the range to actual names or remove unwanted empty rows.
  • The formula is not recognized: RAND and the helper-column method are widely available, but SORTBY and RANDARRAY require Microsoft 365. An older Excel version can use the helper method instead.

Random sorting is useful for everyday mixing, but it should not be treated as a secure random-number generator or as proof that a consequential selection was impartial. Excel’s random functions are intended for spreadsheet calculations, and recalculation makes it easy to change a result unintentionally. For a classroom activity or a casual order, that is usually acceptable; for regulated or high-stakes allocation, use a process designed for that purpose and keep an auditable record.

Excel on Mac and Excel for the web

The core approaches work in current Excel for Mac as well: enter RAND beside the names and sort the full range, or use SORTBY with RANDARRAY if those Microsoft 365 functions are available. Ribbon placement can vary slightly by interface, but the sort command is on the Data tab. For keyboard recalculation, Mac keyboards may require Fn with F9; the exact behavior depends on macOS keyboard settings.

Excel for the web also supports sorting and, where available in the account, dynamic array formulas. Its ribbon and keyboard behavior can differ from the Windows desktop app, so use the Data tab’s sort controls if a shortcut does not work. If the workbook is shared, remember that recalculation can update volatile formulas for other viewers too; paste values before sharing a final fixed order.

Frequently Asked Questions

Can Excel shuffle a list without changing the original?
Yes. In Microsoft 365, put the SORTBY and RANDARRAY formula in an empty area to create a separate shuffled result. The helper-column method can also be used on a copied list so the original remains untouched.

How do I reshuffle names in Excel?
With a RAND helper column, press F9 on Windows to recalculate, then sort by the helper values again if needed. A SORTBY/RANDARRAY result typically updates when Excel recalculates the workbook. Paste values first if you want to preserve the current version.

Can I shuffle names without duplicates?
Yes. Both methods reorder the list rather than drawing independent names, so each source row appears once in the shuffled output. To select a smaller group without repeats, take the first required number of names from the shuffled list.

Why does my shuffled list keep changing?
RAND and RANDARRAY recalculate, so edits and other calculation events may generate new random values. Copy the desired result and paste values to freeze it.

Can I shuffle names in older Excel versions?
Yes. Use a helper column with RAND, fill the formula down, and sort the entire list by that column. The dynamic SORTBY/RANDARRAY method requires Microsoft 365, but the helper method does not rely on those newer functions.

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.