To shuffle numbers in Excel, you don't need a dedicated function: the standard method is to add a column of random values with =RAND() next to your numbers, then sort both columns by that random column. The numbers end up in a random order, and you can paste the result as values to freeze it. Here is the full process, including how to shuffle repeatedly and how to avoid the common traps.

What You'll Need

  • Excel for Windows, Mac, or the web version (the RAND, RANDARRAY, SORTBY and RAND functions work in all current versions; RANDARRAY and SORTBY require Microsoft 365 or Excel 2021 and later).
  • Your numbers in a single column or row, with no blank cells inside the range.
  • A spare column to the right of your data for the random values.

Step-by-Step

  1. Lay out your numbers. Put the numbers you want to shuffle in a single column, for example A2:A21 for 20 numbers. Leave row 1 for headers if you have them. Keep the list contiguous (no gaps), because sorting a range with blanks can move the blanks into the middle of your data.
  2. Add a random helper column. In the first cell of the column immediately to the right (B2 in this example), type =RAND() and press Enter. This returns a decimal between 0 and 1. It recalculates every time the sheet recalculates, which is exactly what you want for shuffling but also means the order is not stable until you freeze it.
  3. Fill the formula down. Select B2, then drag the fill handle down to the last row of your data (B21). Alternatively, double-click the fill handle to fill down automatically. Every row now has its own random value.
  4. Select both columns. Highlight the number column and the random column together, for example A2:B21. Do not select only the number column, or the sort will not follow the random values.
  5. Sort by the random column. Go to the Data tab and click Sort. In the Sort dialog, set Sort by to the random column (column B), Sort on to Values, and Order to Smallest to Largest (or Largest to Smallest; either gives a random order). Click OK. The numbers are now shuffled.
  6. Freeze the result. The order will change the next time anything recalculates, because RAND is volatile. To keep the shuffled order, select the shuffled number column, copy it (Ctrl+C), then right-click and use Paste Special > Values to replace the formulas with fixed values. You can then delete the helper column.
  7. Shuffle again if needed. To reshuffle, press F9 to force a recalculation, which generates new random values, then repeat the sort. If you already pasted as values, re-add a fresh =RAND() column first.

If you have Microsoft 365 or Excel 2021, there is a one-formula alternative that avoids the helper column and the manual sort: =SORTBY(A2:A21, RANDARRAY(ROWS(A2:A21))). SORTBY returns the values in A2:A21 sorted by the random array, producing a shuffled list in a single step. The result is a dynamic array, so it spills into the cells below; paste it as values if you need a fixed order.

Common Mistakes

  • Sorting only the number column. If you sort A2:A21 without including the random column, the numbers are sorted numerically, not shuffled. Always select both columns before sorting.
  • Forgetting that RAND recalculates. Any edit, recalculation, or reopening the file can change the order. Paste as values before you rely on the sequence.
  • Leaving blank rows inside the range. Blanks sort to one end and can split your list. Remove gaps first, or use a dynamic array formula that ignores blanks.
  • Using RANDBETWEEN with duplicates. =RANDBETWEEN(1,100) can repeat values, so two rows may tie and the sort order between them is arbitrary. RAND produces near-unique decimals and avoids most ties.
  • Expecting the shuffle to be reversible. Once you sort and paste as values, the original order is gone unless you kept a copy. Duplicate the sheet before shuffling if the original order matters.

Tips

  • Use =RAND() rather than =RANDBETWEEN() for the helper column; decimals give a cleaner shuffle with fewer ties.
  • To shuffle a list of names or items rather than numbers, the same method works: put the items in column A and the RAND formula in column B, then sort both.
  • If you need a repeatable shuffle, copy the random column and paste it as values before sorting, so the order stays fixed.
  • For a quick reshuffle of a dynamic array formula, press F9; the RANDARRAY recalculates and the SORTBY output changes.
  • Keep a backup copy of the original order on a separate sheet if the sequence is important for auditing or comparison.

Troubleshooting

  • The numbers did not change order. Check that you selected both the number and random columns before sorting, and that the sort key is the random column, not the number column.
  • The order keeps changing on its own. RAND is volatile. Paste the shuffled numbers as values, or convert the formula to a static list, to stop recalculation.
  • RANDARRAY or SORTBY returns a #NAME? error. These functions require Microsoft 365 or Excel 2021 and later. On older versions, use the helper-column method instead.
  • The shuffled list has blanks or missing values. Your source range likely contains blank cells. Clean the range or use a formula that filters blanks before shuffling.
  • The sort dialog shows the wrong column names. If your data has no headers, untick My data has headers in the Sort dialog, or the first row will be treated as a header and left out of the sort.

Frequently Asked Questions

Can I shuffle numbers without sorting?

Yes, if you have Microsoft 365 or Excel 2021: use =SORTBY(A2:A21, RANDARRAY(ROWS(A2:A21))). It returns a shuffled list in one formula. On older versions, the helper-column plus sort method is the practical route.

Why does my shuffled order change every time I edit the sheet?

Because RAND and RANDARRAY are volatile functions that recalculate on any change. Copy the result and use Paste Special > Values to lock the order.

Can I shuffle a list of names instead of numbers?

Yes. Put the names in column A, add =RAND() in column B, and sort both columns by column B. The names come out in random order.

Does the shuffle guarantee no duplicates?

The shuffle reorders existing values; it does not create new ones. If your source list has duplicates, the shuffled list will contain the same duplicates, just in a different order.

Can I reshuffle the same list multiple times?

Yes. Press F9 to recalculate the random values, then sort again. If you already pasted as values, add a fresh RAND column first.

Is there a way to shuffle in Excel for the web?

Yes. RAND, SORTBY and RANDARRAY are supported in Excel for the web, so both the helper-column method and the single-formula method work there.