How to Sort Data in Excel on Mac Without Breaking Your Table

How to Sort Data in Excel on Mac Without Breaking Your Table

Sorting should put a list in a useful order—not pull the price away from its product, or the owner away from their project. In Excel for Mac, the safe approach is to select one cell inside a continuous table, then use Excel's Sort command and confirm that your data has headers. Excel expands the selection to include the full block, so every row moves together.

Quick answer: Click any cell in your table, then choose Data → Sort. Check My data has headers, choose the column to sort by and the order, then select OK. If Excel asks whether to expand the selection, choose Expand the selection—otherwise only one column moves and your table can be mismatched.

What sorting does—and why tables can break

A sort changes the order of rows (or, less commonly, columns) according to one or more rules. Sort a sales table by Amount, for example, and Excel should move each complete sales record together: date, customer, product, amount, and owner.

Trouble starts when Excel is told to sort only one column. The values in that column move, but the rest of each row stays in place. A customer can then be paired with another customer's order total. That is why Excel's Expand the selection prompt matters: it tells Excel that the neighbouring columns belong to the same records.

Before sorting, make sure your data is a clean, uninterrupted block:

  • use one header row, with a label in every column;

  • avoid completely blank rows or columns inside the dataset;

  • do not merge cells within the table;

  • keep totals, notes, and calculations outside the data block, or turn the range into an Excel Table; and

  • save or duplicate a sheet first if the original order is meaningful.

Excel can sort text, numbers, dates, times, colours, icons, and custom lists. It does not know which order is "right" for your business data; that is the rule you choose in the Sort dialog.

At a glance: which sorting method should you use?

MethodHow to startBest forTrade-off
RibbonData → SortAny multi-column or multi-level sortOpens a dialog
MenusData → Sort in the macOS menu barFinding the command without the RibbonSame dialog, more pointer travel
Native keyboardSelect a cell, then use the Mac menu bar with the keyboardKeyboard-first usersExcel has no dependable single built-in shortcut for the full Sort dialog
Mouse workflowUse the filter arrow in a table headerFast ascending or descending sortsBest for one column at a time
MacCove workflowAlt, D, SWindows Excel usersRequires MacCove and its permissions

Method 1: Sort safely from the Ribbon

Use this method when you need to sort by more than one column, choose a custom order, or check the selected range before changing anything.

  1. Click one cell anywhere in the data block. Do not select just the column you want to sort.

  2. Open the Data tab on the Ribbon.

  3. Choose Sort.

  4. Confirm that My data has headers is checked if the first row contains labels such as `Customer` or `Amount`.

  5. In Sort by, choose the first column.

  6. In Order, choose A to Z, Z to A, Smallest to Largest, Largest to Smallest, Oldest to Newest, or the order you need.

  7. Select OK.

If you selected only one column, Excel may show a warning. Choose Expand the selection, then choose Sort. This is the safety choice for a normal row-based dataset.

Sort by more than one column

For a useful report, you may want departments grouped together and, within each department, the highest amount first.

  1. Open Data → Sort.

  2. Set the first Sort by rule to `Department`, ordered A to Z.

  3. Choose Add Level.

  4. Set Then by to `Amount`, ordered Largest to Smallest.

  5. Select OK.

Excel applies rules from top to bottom. In this example, Department is the primary rule; Amount only resolves the order of rows within the same department. Use Move Up and Move Down in the dialog to change that priority.

Method 2: Use the macOS menu bar

The command is also available from Excel's menus, which is handy if you have hidden or collapsed the Ribbon.

  1. Click a cell in the data block.

  2. In the macOS menu bar, choose Data → Sort.

  3. Check My data has headers when applicable.

  4. Choose the column, sort-on option, and order.

  5. Select OK.

The menu and Ribbon open the same Sort dialog. The dialog is safer than the one-click A–Z buttons whenever you need to verify headers, add a second sort rule, or sort by a colour.

Method 3: Use a keyboard-first workflow

Excel for Mac does not provide one universal, built-in shortcut that opens the complete Sort dialog across keyboard layouts and versions. The reliable native keyboard workflow is to select the data cell, activate Excel's menu bar with the keyboard, open Data, and choose Sort; then use Tab, arrow keys, and Return in the dialog.

This is worth learning if you sort frequently:

  1. Use the arrow keys to move to any cell in the table.

  2. Open the Data menu from the macOS menu bar using your keyboard.

  3. Choose Sort.

  4. Use Tab to move between the header setting, column, sort order, and level controls.

  5. Press Return on OK.

Because macOS menu access can vary with keyboard settings, use the visible Data → Sort labels as your guide rather than memorising an unverified key chord. If you need a repeatable Windows-style sequence, MacCove is the faster option below.

Method 4: Sort from a table header with the mouse

When your range is formatted as an Excel Table—or has AutoFilter enabled—each header has a filter arrow. This is the quickest mouse workflow for a simple one-column sort.

  1. Click the filter arrow in the header you want to sort by.

  2. Choose Sort Ascending or Sort Descending.

  3. If prompted, choose Expand the selection.

For numbers, ascending means smallest to largest; for dates, oldest to newest. Descending reverses those directions. The header-arrow menu can also sort by cell colour, font colour, or icon when those options are present.

To create an Excel Table first, click inside the range and choose Insert → Table, then confirm the range and My table has headers. Tables make the data boundaries clearer and carry formulas, formatting, and filters consistently as you add rows.

Method 5: Use MacCove for Windows-style sort commands

MacCove's Mac Excel Shortcuts lets people who know Windows Excel sequences use them in Excel for Mac. Click a cell in your table, then press:

ActionMacCove sequence
Open the Sort dialogAlt, D, S
Open the Filter menuAlt, D, F, F
Reapply filters and sortingAlt, A, Y, 1

After Alt, D, S, choose the column and order in the Sort dialog just as you would with the Ribbon. MacCove is most useful when Windows muscle memory is slowing down work on a Mac; it does not change Excel's underlying sort rules. Set up its required Accessibility and Input Monitoring permissions before relying on the sequences.

Real-world example: sort an invoice list without separating totals from customers

Imagine this invoice table:

InvoiceCustomerDue dateAmountOwner
1048Northwind18 Jul 2026$4,200Mia
1051Alpine Ski15 Jul 2026$950Evan
1056Contoso15 Jul 2026$7,800Mia

You want the most urgent invoices first and the larger invoices first when due dates match.

  1. Click any cell in the table, such as the `Amount` value for invoice 1048.

  2. Choose Data → Sort and check My data has headers.

  3. Set Sort by to `Due date`, Oldest to Newest.

  4. Choose Add Level, then set Then by to `Amount`, Largest to Smallest.

  5. Select OK.

The resulting first rows are 1056, 1051, then 1048. Every value from each invoice remains on its original row, because the complete table moved together.

Common mistakes that break a sort

Sorting one column and choosing Continue with the current selection

This is the classic mismatch. It moves only the selected column, leaving related cells behind. Select Undo (⌘Z) immediately, then repeat the sort and choose Expand the selection.

Forgetting to check My data has headers

If your first row is labels but the header option is off, Excel treats the labels as ordinary data and sorts them into the list. Undo, reopen Sort, and check My data has headers.

Leaving blank rows inside the dataset

Excel often treats a blank row or column as the edge of the current region. Data below or beyond it may be excluded from the sort. Remove internal blank rows, or explicitly select the complete intended range before opening Sort.

Sorting a subtotal row with the details

Subtotal formulas can move into the middle of a list and stop representing the right group. Keep totals outside the sort range, use an Excel Table with a Total Row, or sort the source detail rows before adding subtotals.

Sorting dates that are stored as text

Text dates sort alphabetically, which can put `12/01/2026` before `2/01/2026`. Convert them to real Excel dates first, then sort Oldest to Newest.

Using merged cells in the table

Merged cells make a rectangular data structure ambiguous and can prevent a sort. Unmerge the cells, repeat labels in their own cells if needed, and then sort.

Relying on Undo after closing or heavily editing the workbook

Undo is excellent for an immediate correction, but it is not a version-control system. Keep an unsorted copy or add an `Original order` column with sequential numbers before experimenting with a new sort.

Windows equivalent

TaskExcel for MacExcel for Windows
Open the Sort dialogData → SortData → Sort
Fast sort from a headerHeader filter arrow → Sort Ascending/DescendingHeader filter arrow → Sort A to Z/Z to A
Sort safely after selecting one columnChoose Expand the selectionChoose Expand the selection
Windows-style sequence with MacCoveAlt, D, SAlt, D, S
Undo a mistaken sort⌘ZCtrl+Z

FAQs

How do I sort a table in Excel for Mac without messing up rows?

Click a cell inside the table, open Data → Sort, and choose your column and order. If Excel asks, select Expand the selection. That keeps every row's fields together.

Why is Excel sorting only one column?

You probably selected only that column and chose to continue with the current selection, or blank rows/columns split the dataset. Undo the sort, select a cell in the full data block, and use Expand the selection.

How do I sort by two columns in Excel for Mac?

Open Data → Sort, set the first rule, choose Add Level, then set the second rule. Excel applies the top rule first and the next rule within matching groups.

Can I sort alphabetically in Excel for Mac?

Yes. Choose the text column in the Sort dialog and select A to Z or Z to A. For a quick one-column sort in a table, use that column's header filter arrow.

Can I restore the original order after sorting?

Use ⌘Z immediately. For a durable way to restore it later, add an `Original order` column numbered 1, 2, 3, and so on before sorting; sort by that column when you need to return to the starting order.

Does filtering sort data safely too?

Yes. Sorting from a header filter arrow sorts the entire Excel Table or filtered range, so related row data stays together. It is still wise to check for blank rows and merged cells first.

Related guides

Sources

← Back to all articles