Yes. Excel has no single Shuffle command, but you can randomize a list or whole rows by adding a RAND() helper column and sorting by it; Microsoft 365 also offers formulas that return shuffled values. Choose the method based on whether each value can move independently or whether related cells must stay together.
What shuffling means in Excel
Shuffling means putting items into a random order. The important question is what counts as an item. If a worksheet contains names in one column, you can shuffle the names independently. If each row contains a name, department, and score, the whole row is usually the item: moving just the name would attach it to the wrong score.
Excel does not provide a built-in shuffle button in the standard ribbon. Instead, you assign a random number to each item and sort by that number. This is a practical way to create a randomized order, but it is not a permanent draw unless you preserve the result. Random values can change when Excel recalculates the worksheet.
- Shuffle records: randomize the order of complete rows while keeping each row’s fields together.
- Shuffle values: rearrange individual entries in a list, or across a rectangular range, independently of their original positions.
- Shuffle a selection: randomize only a chosen range, leaving the rest of the worksheet alone.
Shuffle complete rows with a helper column
This is the safest general-purpose method for randomizing records. It works in current desktop versions of Excel, including Microsoft 365, and does not require a newer dynamic-array function.
- Make a backup or duplicate the worksheet if the original order matters.
- Add a blank helper column beside the records. If the data has headers, give the helper column a label such as Random.
- With records in A2:D11 and the helper in E2:E11, enter
=RAND()in E2, then fill it down through E11. Each row receives a random decimal value. - Select the entire data range, including all record columns and the helper column. Do not select only the helper values.
- Choose Data > Sort, set the sort column to Random, and choose either smallest to largest or largest to smallest. If Excel asks, choose to expand the selection so every row stays intact.
- After sorting, delete the helper column if you no longer need it.
In this example, A2:D11 contains ten records and E2:E11 holds the random keys. =RAND() returns a different random decimal in each filled cell, so the resulting order varies; there is no fixed list of results to calculate in advance. Sorting the whole range by E rearranges the ten records, not the values within each record. On Windows, the Sort command is on the Data tab; Excel for Mac also has a Data sorting command, although the ribbon layout can differ slightly.
Shuffle a single list with a formula
If you have Microsoft 365 or Excel 2021 or later, a dynamic-array formula can return a randomized version of a list without sorting the original cells. With values in A2:A11, enter this formula in an empty cell outside the source range:
=SORTBY(A2:A11,RANDARRAY(ROWS(A2:A11)))
The formula returns the ten source values in a randomized order and spills them into the cells below. Its order is not predetermined: each calculation produces a randomized permutation. Leave the spill area empty, or Excel may show a spill error. The original A2:A11 list remains unchanged, which is useful when you want to compare the shuffled output with the source or generate another order.
SORTBY, RANDARRAY, and ROWS are used here to generate one random sort key for each source row. Because RANDARRAY is volatile, the displayed order can change when Excel recalculates, such as after an edit or a recalculation command. This formula is not a suitable choice if you need the displayed order to remain fixed without taking an extra step.
Shuffle every value in a rectangular range
Sometimes each cell is an independent entry and you want the values mixed across a block, rather than keeping rows together. In Microsoft 365 or Excel 2024, a formula can flatten a filled range into a list, randomize that list, and wrap it back into the original number of columns.
For a fully populated 3-by-3 range in A2:C4, put this formula in an empty area:
=WRAPROWS(SORTBY(TOCOL(A2:C4),RANDARRAY(ROWS(A2:C4)*COLUMNS(A2:C4))),COLUMNS(A2:C4))
The output is a new 3-by-3 block containing the nine original values in a randomized arrangement. There is no single expected arrangement, because the random keys vary with recalculation. TOCOL turns the source range into a column, SORTBY randomizes its order, and WRAPROWS lays the results out in rows of three. The source cells are not altered.
Use this approach only when individual cell values can be separated from their original rows and columns. The example assumes every source cell contains a value. If the range has blanks, merged cells, formulas with dependencies, or labels that should stay associated with data, first decide how those should be treated; a simple flatten-and-shuffle formula may not preserve the meaning of the layout. The output spill area must also be clear.
Keep a shuffled result from changing
Both RAND() and RANDARRAY() generate new random values when Excel recalculates. That behavior is useful when you want a fresh shuffle, but inconvenient when you need to retain a particular order for a worksheet, handout, or later review.
- For a helper-column sort: once the rows are in the desired order, copy the sorted range and use Home > Paste > Values to replace formulas with fixed values, or remove the helper column. Keep a copy of the original data if you may need to restore it.
- For a formula result: copy the spilled output and paste values into another range. This preserves the displayed order as ordinary cell contents rather than a formula that recalculates.
- For another shuffle: recalculate the worksheet or enter fresh random helper values, then sort again. Remember that recalculation can affect other random formulas on the sheet too.
On Windows, Ctrl+Z undoes a recent sort or edit where undo is available; on Mac, use Command+Z. Do not rely on undo as your only backup when rearranging important data. A copy of the worksheet is a more dependable way to retain the starting order.
Common mistakes and how to avoid them
- Sorting only the helper column: this changes the random keys but leaves the records where they are. Select the full data range and expand the selection when Excel offers that option.
- Separating fields that belong together: sorting a names column by itself can mismatch names and their other record details. Use a helper value per row and sort the complete table or range.
- Including a header as a record: identify the header row in the Sort dialog and confirm that Excel recognizes headers. Otherwise the heading might be mixed into the shuffled results.
- Expecting a formula shuffle to stay put: random formulas can recalculate. Paste the result as values when you need a stable order.
- Blocking a spilled formula: clear the cells where a dynamic-array result needs to appear. Merged cells or existing content in that area can prevent the output from spilling.
- Expecting each possible order to be equally guaranteed: the method creates a randomized order, not a formal guarantee or audited random draw. For a regulated contest, research study, or other high-stakes selection, use a process designed for that requirement and document it.
Which method should you choose?
Use a helper column when the goal is to shuffle whole records, when you want broad version compatibility, or when you need to see and sort by the random keys. It is also straightforward to repeat: recalculate the helper values and sort again. Be careful to include every column belonging to each record.
Use SORTBY for a shuffled list when you want a separate, formula-driven result and have Microsoft 365 or Excel 2021 or later. Use the TOCOL and WRAPROWS approach only when every cell in the selected block is an independent item and the rectangular output is useful. These formula methods do not overwrite their sources, but their results are dynamic until pasted as values.
If all you need is a one-time random sequence, a helper column is usually the clearest method. If you need a reusable display that can refresh, a dynamic formula can be more convenient. If the data represents records, preserving row relationships matters more than choosing the shortest formula.
Frequently Asked Questions
Does Excel have a Shuffle button?
No. Excel’s standard interface does not include a dedicated Shuffle command. A random helper column followed by a sort is the usual way to shuffle records; formulas can return randomized lists in supported versions.
Can I shuffle rows without mixing up the data in them?
Yes. Put one RAND() value beside each record, select the full table or range, and sort all columns by the helper values. Each row moves as a unit, so its fields remain together.
How do I shuffle cells without repeating values?
Sorting the original entries by independent random keys rearranges the entries; it does not intentionally duplicate or remove them. Check that the selected source range contains the items you mean to shuffle and that the entire range is included.
Why did my shuffled order change?RAND() and RANDARRAY() can recalculate, producing new random keys or output order. Paste the result as values if you want to keep the current arrangement.
Can I shuffle cells in Excel for the web or on Mac?
The helper-column and sort approach is available in Excel for the web and Excel for Mac, though menus and ribbon layouts may differ from Windows. Dynamic-array function availability can depend on the version; use Microsoft 365 or Excel 2024 for the rectangular formula shown above.
Related
- How to Unmerge Cells in Excel and Keep Data
- Unmerge Cells in Excel on iPad: Step-by-Step
- Unmerge Cells in Excel: Shortcut Key and Steps for Windows
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- XLOOKUP in Excel: How to Build and Use the FormulaTo look up a product price by ID, put the ID to find in E2, the product IDs…
- Excel Formula for Age From Date of BirthThe simplest Excel formula for age from a date of birth is =DATEDIF(A2,TODAY(),"Y"), assuming the birth date is…
- Excel Not Highlighting Cells in Formula? Try These FixesExcel highlights referenced cells only while you are editing a formula: select the formula cell and press F2,…
- Excel FILTER Formula for Multiple CriteriaTo filter rows in Excel by multiple criteria, use FILTER with a condition for each test: multiply the…
- Excel MAX with Criteria: Formula & ExamplesThe quickest way to find the maximum value in Excel based on one or more criteria is to…
- SQL String Functions: Four Common ExamplesFour useful SQL string functions are UPPER, LOWER, CONCAT, and a length function such as LENGTH. They change…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.