Custom Sort Excel: Build Any Order You Want

Learn how to define custom sort orders.

Most Excel tutorials treat alphabetical as the default sort order and leave it at that. It isn't — not for anyone managing real data. If your report tracks tickets by High, Medium, Low priority, alphabetical puts High first by coincidence and Medium last. That's not a sort order. That's chaos with good formatting. A custom sort order tells Excel exactly what sequence to follow, whether you're sorting by department hierarchy, project phase, or a region list your company invented in 2019 and never explained to anyone. This works across Excel 2010 through Microsoft 365, with no meaningful differences between versions. One prerequisite worth stating now: custom lists are stored in Excel's application settings on your machine, not in the workbook. More on that shortly, because it's the detail that bites almost everyone.


Step 1: Open the Sort Dialog Box and Add the Levels That Control Your Order

How to Reach the Sort Dialog Box and Add Sort Levels

Start by clicking anywhere inside your data. Not just a single cell in the column you want to sort — anywhere in the range. Excel is usually smart enough to detect the boundaries, but if your data has gaps or odd formatting, select the whole range manually before doing anything else.

  1. Go to the Data tab on the ribbon.
  2. Click Sort. The Sort dialog box opens.
  3. Make sure My data has headers is checked if your first row contains column names. If it isn't checked, Excel will sort your header row into the data.
  4. Click Add Level to insert your first sort rule.

Each sort level appears as a row inside the dialog. You can add multiple levels, reorder them with the arrow buttons, and delete ones you don't need. Excel works through them top to bottom — the first level takes priority, the second breaks ties within that group, and so on. If you're new to sorting in general, the introduction to sorting and filtering in Excel covers the core mechanics before you get into custom lists.

Choosing What to Sort By: Column, Cell Color, or Cell Value

The Sort On dropdown gives you three main options: Cell Values, Cell Color, and Font Color. Most of the time you want Cell Values — that's sorting by the actual text or numbers in the column. Cell color sort is useful if you've been manually highlighting rows to flag status, but it's a workaround more than a system. If you're doing color-based sorting regularly, the guide on sorting by cell color, font color, and icons will save you some trial and error.

Pick your column under Sort By, leave Sort On as Cell Values for now, and then look at the Order dropdown. This is where the custom sort logic lives.


Step 2: Build a Custom List So Excel Knows Your Exact Sort Order

Creating the Custom List from Scratch (or from Existing Cells)

Once you've opened the Sort dialog and added a level, click the Order dropdown for that level. You'll see A to Z, Z to A, and at the bottom: Custom List. Click it.

A separate window opens — the Custom Lists dialog. On the left, you'll see a few lists Excel ships with by default: days of the week, months of the year, and abbreviations of both. On the right is the List entries box where you type your own sequence.

  1. Click NEW LIST in the left panel.
  2. In the List entries box, type your values in order, one per line. For a priority sort: High, then Medium, then Low.
  3. Click Add. Your list appears on the left.
  4. Click OK to return to the Sort dialog.

If your values already exist in a column somewhere in the workbook, you can skip the typing. Use the Import list from cells field at the bottom of the Custom Lists dialog, select the cell range, and click Import. It's faster and less likely to introduce a typo that makes your sort silently fail.

The Portability Catch: What Happens on Another Computer

Custom lists are stored in your local Excel application settings — in the Windows registry — not inside the .xlsx file. If you send a workbook to a colleague, they won't have your list. Excel will fall back to alphabetical on their machine.

If you're collaborating, you have two options: document your list and ask colleagues to recreate it on their end, or use a formula-based approach instead. The SORTBY function combined with MATCH lets you define a sort sequence inside the workbook itself, which does travel with the file. It's more setup, but for shared workbooks it's often the right call. Microsoft's official SORTBY documentation is the clearest reference if you want to go that route.


Step 3: Sort by Multiple Columns and Confirm the Result Looks Right

With your custom list set, you're back in the Sort dialog with one level configured. If you need a second sort — say, by department first, then by priority within each department — click Add Level again and configure it the same way.

Excel reads sort levels top to bottom. The first level is the primary sort. The second breaks ties inside each group from the first. A third breaks ties inside those. Chain as many as you need, though in practice more than three gets unwieldy fast.

Before clicking OK, double-check that My data has headers is still checked. Excel can lose that setting if you've been adjusting levels. A header row sorted into the middle of your data is one of those errors that's obvious once you see it and maddening before you do.

The Excel for beginners guide has a good section on identifying and locking header rows if that's tripping you up.


Common Custom Sort Mistakes in Excel (Including the One That Silently Scrambles Your Data)

After years of using Excel in corporate finance — where a misaligned sort could throw off an entire reporting package — I've hit every one of these. So has almost every reader who ends up searching "custom sort order not working Excel" at 4pm on a deadline.

Sorting a partial selection

If you highlight only one column before opening the Sort dialog, Excel may ask whether to expand the selection. Always expand it. Sorting a single column without expanding shifts that column's data while leaving every adjacent column in place. The sort completes without an error message. Your data is now wrong in a way that's hard to spot.

A protected worksheet blocking the sort

Excel won't always tell you clearly that protection is the problem — it'll just refuse to sort or gray out the option. Check Review > Unprotect Sheet first.

Your custom list disappearing after the file moves

The list lives in your Excel settings, not the file. Recreate it on the new machine, or switch to a SORTBY MATCH formula for anything shared.

Merged cells breaking the sort

Merged cells actively break sorting, and they won't always surface a useful error message. Unmerge before you sort, always.

If you're running into sorting problems beyond these, the common sorting errors and fixes guide covers the longer list.

If you take one thing from this article: custom sort lists are stored in Excel, not your workbook. Build the list, apply the sort, and if the file is going anywhere — document the list or use a formula instead.

Frequently Asked Questions

Do custom lists transfer to other computers in Excel?

No. Custom lists are stored in Excel's local application settings — in the Windows registry — not inside the workbook file. If you send a file to a colleague, they'll need to recreate the custom list themselves, or you'll need to use a formula-based approach like SORTBY with MATCH that stores the sort logic inside the workbook.

Why is my custom sort not working in Excel?

The three most common causes are: sorting a partial selection (which shifts only one column while leaving adjacent columns untouched), a protected worksheet silently blocking the operation, or a custom list that no longer exists on the current machine. Check for merged cells too — they'll break a sort without a useful error message.

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

SORT returns data sorted by one or more columns in ascending or descending order. SORTBY is more flexible — it lets you sort an array by a separate reference array, which is what makes the SORTBY MATCH formula work: MATCH returns a list of positions based on your custom sequence, and SORTBY uses those positions to sort your data in that exact order.