Sort Excel Tables on Windows: Step-by-Step Guide

Learn how to sort table data efficiently.

Most tutorials will tell you that sorting an Excel table is basically automatic — just click a header and you're done. That's true about 70% of the time. The other 30% is where people lose data, break linked formulas, or end up with a sort result that looks plausible but is completely wrong. If you've ever inherited a workbook where someone "sorted" a table and silently scrambled three sheets worth of references, you know exactly what I mean.

This guide covers how to sort Excel tables on Windows the right way: from the fastest single-column sort to multi-level custom sorts to non-destructive SORT formulas, plus the four mistakes that most tutorials never bother to explain. I'm running Microsoft 365 on Windows, which is where all the screenshots and shortcuts below apply. If you're on Excel 2019 or 2021, I'll flag the one place where your experience differs.

What You Can Sort — and Two Things to Check Before You Touch Your Table

Sorting an Excel table reorganizes rows based on the values in one or more columns: ascending order, descending order, by color, or by a custom sequence. The key word is rows. Excel tables sort top to bottom only. If you need to sort columns left to right, you'll have to convert the table to a range first — Excel won't let you run a left-to-right sort on a Table object. That limitation catches people off guard every time, so it's worth flagging before you spend ten minutes looking for an option that doesn't exist.

Before you sort anything, confirm your data is structured as a proper Table, not just a formatted range. Click anywhere in your data. If the Table Design tab (or "Table" tab, depending on your version) appears in the ribbon, you're good. If it doesn't, check out Working with Excel Tables and Ranges to get that set up first. Also check for merged cells. Merged cells will either throw a sort error or produce garbage output. Unmerge before you sort.

Merged cells and sorting don't mix. If your table contains any merged cells, Excel will either refuse to sort or silently produce incorrect results. Unmerge all cells before proceeding.


Step 1: Sort Your Excel Table by a Single Column Using the Header Dropdown or Keyboard Shortcut

With your table confirmed, click the dropdown arrow on any column header. You'll see Sort A to Z (ascending) and Sort Z to A (descending) at the top. Click either one. Excel sorts the entire table — every row moves together, preserving your data relationships.

The keyboard shortcut sequence is faster once you know it:

  1. Alt → A → S → A sorts ascending order
  2. Alt → A → S → D sorts descending order

These are sequential key presses, not held simultaneously. Press Alt, release, press A, and so on.

If you sort and immediately regret it, Ctrl + Z undoes the sort as long as you haven't closed the file. Get in the habit of using it before saving.

One thing that trips people up: if your column contains mixed data types — some cells with numbers stored as text, others as actual numbers — the sort order will look wrong. Excel sorts text and numbers separately. Fix the data type inconsistency first, not the sort settings.


Step 2: Sort an Excel Table by Multiple Columns Using the Custom Sort Dialog

Single-column sorting handles most cases, but when you need to sort by multiple columns — say, by Region first, then by Sales Rep within each region — the Custom Sort dialog is where you go next.

Open it with Alt → A → S → S, or go to Data → Sort in the ribbon. This is the same Custom Sort dialog whether you're on Windows 10 or Windows 11 in Microsoft 365.

Add and Reorder Sort Levels So Excel Sorts in the Right Priority

In the dialog, click Add Level to stack sort criteria. The top level runs first. In a Regional Office Supply Orders table with 847 rows, if you want rows grouped by Region and then alphabetized by Rep within each region, Region goes in the first row of the dialog and Rep goes in the second. Swapping those levels gives you a completely different result: Rep would sort globally, and Region would only break ties between reps with identical names. Level order matters more than most people expect.

Use the up and down arrows on the right side of the dialog to reorder levels after you've added them.

Sort by Cell Color or Icon When Your Table Uses Conditional Formatting

In the "Sort On" dropdown within the dialog, you can switch from Cell Values to Cell Color, Font Color, or Conditional Formatting Icon. This works, and it's there if you need it — but sorting by color is usually a signal that you need a proper category column instead. A color is not a data point. If every red row represents a late order, you're better off with a Status column containing the word "Late" that you can filter, sort, and formula-reference reliably. That said, if you've inherited a color-coded table and just need it sorted today, this feature does the job.


Step 3: Use SORT or SORTBY for a Non-Destructive Sort That Updates Automatically

Everything in Steps 1 and 2 modifies the table in place. That's fine for most use cases, but if you need a sorted view that updates automatically without touching the source data, the SORT and SORTBY functions are the answer.

SORT and SORTBY are Microsoft 365 features only. Excel 2019 and Excel 2021 do not include them.

Here's the practical difference:

  • SORT sorts a range or array by a column position within that array.
  • SORTBY sorts by a separate array, which gives you more flexibility — you can sort a table's output by a column that isn't even in the returned result.

A minimal SORTBY example: =SORTBY(tblOrders[#All],tblOrders[OrderDate],1) returns the entire tblOrders table sorted by OrderDate ascending, spilled into a new location. The original table is untouched.

There's a catch: these functions work on a range or array, not directly on a Table object as the output destination. If you want the result to feed back into a structured table, you'll need to convert the output range to a table after the spill lands. See Microsoft's official SORTBY function documentation for the full argument syntax.


Four Common Mistakes When Sorting Excel Tables on Windows

This is what most sorting tutorials skip. Here are the four mistakes I see most often in production workbooks.

Formulas on a linked sheet break after sorting

If Sheet2 references specific cell addresses in your table — like =Sheet1!B4 — and you sort the table, row 4 now holds different data and those formulas are wrong. The fix is to use structured references like =tblOrders[@Sales] instead of cell addresses. Structured references follow the row, not the position. This is the single strongest argument for always naming your tables and using structured references in Excel tables.

Left-to-right sort fails on a Table object

Excel tables don't support left-to-right sorting. You must convert the table to a range first (Table Design → Convert to Range), run the sort (Data → Sort → Options → Sort Left to Right), then optionally reformat as a table. Annoying, but that's the constraint.

Mixed data types scramble sort order

A column that mixes text and numbers — common in poorly maintained product code columns — will sort incorrectly. Excel separates numbers from text in the sort sequence rather than treating them uniformly. Standardize the data type across the column before sorting.

Partial-table sort from a multi-column selection

If you've selected only two columns before opening the sort dialog, Excel may sort only that selection and leave the rest of the table in its original order. Always click a single cell inside the table before sorting — never a multi-column selection — and let Excel detect the full table range automatically.


Frequently Asked Questions

What is the keyboard shortcut to sort in Excel on Windows?

Press Alt → A → S → A for ascending order or Alt → A → S → D for descending order. These are sequential key presses, not held simultaneously. To open the full Custom Sort dialog, use Alt → A → S → S.

Why does sorting in Excel break my formulas on another sheet?

If your formulas reference specific cell addresses (like =Sheet1!B4), sorting moves rows but the cell references don't follow. Switch to structured references like =tblOrders[@Sales] — they reference the row by its table relationship, not its physical position, so sorting the table doesn't break them.

Can you sort an Excel table left to right on Windows?

Not while it's formatted as a Table object. You need to convert it to a range first (Table Design tab → Convert to Range), then go to Data → Sort → Options and select "Sort left to right." After sorting, you can reformat the range as a table if needed.

What's the difference between the SORT and SORTBY functions in Excel?

SORT reorders an array by a specified column index within that array. SORTBY sorts one array based on a separate "by" array — useful when you want to sort a dataset by a column that isn't included in the returned result. Both are Microsoft 365-only and neither modifies the source data. If you're new to these functions, the Excel for Beginners guide covers the foundational concepts behind array functions.