Sort by Color in Excel: Cell Color, Font & Icons
Your status column is color-coded — green for on track, amber for at risk, red for overdue — and you need every red row at the top before the 9 AM stand-up. You know the colors mean something. Now you need Excel to act on them. That's exactly what sort by color in Excel does, and it's more capable than most people realize.
You can sort by cell fill color, font color, or icon set markers. All three use the same Custom Sort dialog, but they behave differently, fail differently, and serve different workflows. Before walking through each one, two things need to be in place.
What You Can Sort — and What to Check Before You Sort by Color in Excel
Excel's color sort works on manual fill colors, font colors, and icon sets applied through conditional formatting. The Data tab gives you access to all three through the same Custom Sort dialog.
Check these two things first. Your data needs to be a contiguous range: no blank rows splitting the table, no stray values outside the selection. Merged cells will stop the sort entirely (more on that in the mistakes section below).
If you're on Excel for the Web, the Sort On dropdown is disabled. You'll see the menu, but the color and icon options won't activate. This is a hard platform limitation — Microsoft's own documentation confirms it. Switch to the desktop app in Microsoft 365 before you try any of this.
|
| The Custom Sort dialog gives you full control over cell color, font color, and icon sorting — all in one place. |
Step 1: Open the Custom Sort Dialog and Set Your Sort On Dropdown to Cell Color or Font Color
Click anywhere inside your data range, then go to the Data tab and click Sort. That opens the Custom Sort dialog — not the quick A–Z button, the full dialog. If you've been using the right-click shortcut that says "Sort by Color," that works for a single color, but the Custom Sort dialog is where you get control over multiple colors at once.
In the dialog, set the Column to the column holding your colors. Then open the Sort On dropdown and choose Cell Color or Font Color depending on what you've applied. The Order dropdown to the right will populate with every color present in that column. Pick the color you want at the top, leave "On Top" selected, and click OK.
That handles one color. Clean and simple.
How to Sort by Multiple Colors in a Single Pass
To sort multiple colors (red first, then amber, then green), you need a separate sort level for each color. Click Add Level in the Custom Sort dialog for each additional color. Set the same column and the same Sort On value, but choose a different color in the Order dropdown for each level. Excel processes levels top to bottom, so put your highest-priority color in the first level.
"On Top" and "On Bottom" are your only order options for color sorts. There's no ascending/descending equivalent. You're telling Excel where to send each color, not how to rank values within them. If you also need alphabetical order within each color group, pair this with multi-level sorting — add a text or value sort level below your color levels in the same dialog.
This works in Microsoft 365 and Excel 2019. In Excel 2019, the dialog looks slightly different and the color swatches render smaller, but the logic is identical.
Step 2: Sort by Icon Sets When Traffic-Light Icons Drive Your Workflow
Once you've handled cell and font colors, icon sets are the next step — and the most underused part of this whole workflow.
Back in the Custom Sort dialog, open the Sort On dropdown again and this time choose Cell Icon. The Order dropdown will now show the icons from your conditional formatting rule: the red circle, yellow circle, green circle, or whatever set you're using. Pick the icon you want at the top of the list.
The icons only appear as options if they've been applied through a conditional formatting icon set rule. Manually inserted symbols won't show up here. Excel sorts icons in the order you define in the sort dialog, not the order they appear in the icon set rule, which means you can put the yellow flag above the red one if your workflow calls for it. For KPI dashboards and project tracking, icon-based sorting is often the cleaner solution than sorting by fill color.
I've been building executive dashboards for 15 years, and in 2026 I'm still seeing teams manually reorder rows that icon-based sorting would handle in four clicks. The traffic-light palette I use most, with a teal "complete" state alongside the standard red/amber/green, sorts perfectly once the conditional formatting rule is set correctly.
How to Undo a Color Sort and Restore Your Original Row Order
Ctrl+Z works immediately after sorting, before you do anything else. That's your fastest undo and it works reliably on Windows in Microsoft 365 and Excel 2019.
The safer method is a helper column. Before sorting, add a column, number the rows 1, 2, 3 sequentially, then sort by color. When you need the original order back, sort by that helper column ascending. The most common sorting errors I see come from people skipping this step and assuming Ctrl+Z will be available later. Once you save and close, that original row order is gone, and Ctrl+Z won't help.
Common Mistakes That Break Color Sorting in Excel — and How to Fix Each One
- Sort by color is greyed out. The sheet is either protected or you have an active filter running. Check the Data tab for an active filter indicator (the funnel icon with lines) and clear it. If the sheet is protected, unprotect it first under the Review tab.
- Conditional formatting colors don't appear in the Sort dialog. Colors applied through conditional formatting rules do show up in the Sort On dropdown for cell color — but only if the rule is actually firing. If they're not appearing, the rule isn't applying correctly to that range. Triple-check the rule's "Applies to" range and its threshold logic before assuming the sort dialog is broken. The sort will faithfully reproduce any misconfiguration at scale.
- Merged cells. Excel refuses to sort a range containing merged cells. Unmerge them first: Home tab, Merge & Center dropdown, Unmerge Cells. Then re-run the sort.
- Excel for the Web. As noted above, the Sort On menu is present but the color and icon options are disabled. There's no workaround within the browser — open the file in the desktop app.
If you're newer to Excel's sorting tools overall, the Excel for Beginners guide covers the foundational sort mechanics this article builds on. If you're working on a Mac, the Custom Sort dialog path is slightly different — the sorting and filtering guide for Mac covers those differences specifically.
Frequently Asked Questions
Why is sort by color greyed out in Excel?
The most common causes are a protected sheet or an active filter on your data. Clear the filter from the Data tab or unprotect the sheet under the Review tab. If you're in Excel for the Web, the color sort options are disabled at the platform level — you'll need to switch to the desktop app.
Why don't conditional formatting colors show up in the Sort dialog?
They should, but only if the conditional formatting rule is actually applying to the cells you've selected. Check that the rule's "Applies to" range matches your selection and that the rule conditions are triggering correctly. If the rule isn't firing, no color will appear in the Sort On dropdown.
How do I undo a color sort and restore my original row order?
Use Ctrl+Z immediately after sorting if you haven't done anything else. For a recoverable sort at any point, add a helper column with sequential row numbers before sorting, then re-sort by that column ascending to restore the original order. Without one of these two methods, the original sequence is permanently lost once the file is saved.
Join the conversation