Can You Sort Excel by Color? Steps and Tips

Formulas & functions · Updated November 19, 2026

Yes. In Excel for Microsoft 365 on Windows, select your data and choose Data > Sort, then set Sort On to Cell Color, Font Color, or Conditional Formatting Icon. Choose the color or icon and whether it should appear On Top or On Bottom; Excel rearranges the rows in the selected range or table.

What sorting by color does

Sorting by color puts rows with a chosen visual feature together at the top or bottom of a list. For example, if a project tracker uses red fill for overdue tasks, you can put red rows first to review them. Excel can sort by a cell’s fill color, by the color of its text, or by an icon displayed through conditional formatting. These are separate choices in the Sort On menu.

Color is a presentation property, not a value Excel interprets as meaning something. Excel does not know that red means overdue or green means approved; it only groups cells according to their formatting. You choose which color goes first. Sorting by color does not change the fill or font color itself, and it does not delete records. It changes the order of the rows in the sorted range.

This can be useful when colors are a convenient visual label, especially in a small list or a review workflow. For reporting or repeated analysis, it is usually safer to store the category in a column as text, such as Status or Priority, and sort by that value. A named status is easier to filter, count, validate, and understand than a color alone.

How to sort a range by cell color

In Excel for Microsoft 365 on Windows, use the Sort dialog when you want to control the column, color, and direction. First make sure the rows and columns that belong together are included in the data range.

  1. Click a cell inside the data. If the data is not a formatted table, check that it has a clear header row and no completely blank rows or columns splitting the range.
  2. Open Data > Sort. If prompted, confirm that the data has headers. In the Sort dialog, turn on My data has headers if the first row contains column names.
  3. In Sort by, choose the column that contains the colored cells. In Sort On, choose Cell Color.
  4. In Order, choose the color to place first and choose On Top or On Bottom.
  5. Select OK to apply the sort. Check a few records to confirm that each row’s information stayed together.

The color needs to be in the column you selected in Sort by. If a task’s status color is in column C, for instance, choose that status column rather than sorting by a neighboring column that happens to contain another color. If the color is on a different cell in each row, sort by the column whose cells consistently carry the color you want to use as the criterion.

Sorting by font color or conditional-formatting icons

The Sort dialog supports more than fill color. To sort based on colored text, choose Font Color in Sort On. Then select the font color and position it On Top or On Bottom. This is useful when the cell backgrounds are the same but important entries have been marked with colored text.

If cells show symbols such as traffic lights, arrows, or flags from conditional formatting, choose Conditional Formatting Icon in Sort On. Select the icon and choose where it belongs. This sorts by the displayed icon, not by an assumed meaning such as good or bad. For example, you can put rows with a red traffic-light icon first, but Excel will not decide the desired order of the other icons for you.

These options are not interchangeable. A red font on a white background is different from a red fill, and neither is the same as a red conditional-formatting icon. If the result is unexpected, check the actual formatting feature and the column selected in Sort by.

Putting several colors in a specific order

A single sort level places one chosen color at the top or bottom; it does not automatically create a meaningful sequence for every color in the column. To specify a sequence, use multiple levels in the Sort dialog. Choose Add Level, set the same column and sorting feature, then select the next color and its position. Add further levels for the other colors you want to place explicitly.

For example, imagine a support list in which red means urgent, yellow means waiting, and green means complete. Add levels that place red first, yellow next, and green after it. Set the levels in the desired priority order. If you also want names alphabetized within each color group, add a further level using the Name column and Sort On set to Cell Values, with A to Z as the order.

Before applying a multi-level sort, think through the intended final sequence. Excel follows the levels in the dialog; it does not infer a ranking from the colors’ appearance or from their meanings in your workplace. For a recurring workflow, consider using a text priority column with values such as Urgent, Waiting, and Complete, then sort that column using a custom order or helper values. That makes the intended ranking explicit and easier for another person to reproduce.

Sorting versus filtering by color

Sorting and filtering solve different problems. Sorting rearranges the rows so a color group appears earlier or later, while keeping the other rows visible. Filtering by color temporarily hides rows that do not match the selected color, so you can focus on one group without changing the relative order of the visible records.

To filter, turn on filtering with Data > Filter, open the filter arrow in the relevant column, and choose Filter by Color. Pick the available cell color or font color. If the column has conditional-formatting icons, an icon filter may also be available. Clear the filter from that column when you want to show all rows again. Filtering is often a better choice when you only need to inspect the red items and do not want to reorganize the full list.

One practical distinction: a filtered list can make it look as if rows have disappeared, but the filter is hiding them, not deleting them. A sort, by contrast, changes their order. If the goal is to send or print only one color group, filtering may be more appropriate; if the goal is to group every color in a new order, sort.

Keep each record’s data together

The most important safety check is selecting the whole dataset, not just the colored column. A record often spans several columns: task, owner, due date, and status, for example. If you sort only the status column, names and dates may no longer match the right tasks. When Excel detects adjacent data, it may ask whether to Expand the selection or Continue with the current selection. Choose Expand the selection so the complete rows move together.

Excel tables make this easier because a sort applied to a table column keeps the row data together and includes the table’s headers and structured range. You can create a table by selecting the data and choosing Insert > Table, then confirming whether the range has headers. Tables are useful for lists that grow over time, though you should still verify that the intended data is included before sorting.

Before a significant reordering, save the workbook or make a copy, particularly if other people rely on the current order. A sort can usually be reversed immediately with Ctrl+Z on Windows, but later edits or other operations can make undo less convenient. If the existing row order has meaning, add a sequence-number column first so you can restore it by sorting on that number.

Common problems and what to check

  • The colored rows do not appear together: Confirm that Sort by points to the column containing the color and that Sort On is set to the correct feature—Cell Color, Font Color, or Conditional Formatting Icon.
  • The rows are separated or mismatched: Undo at once if possible, then sort the full range or table. Do not sort an isolated column when the other columns describe the same records.
  • A color is missing from the Order list: Check whether that color is actually present in the selected column, and whether it is a fill, font color, or conditional-formatting result. The dialog offers colors relevant to the selected sort column and feature.
  • The result changes after editing a value: A conditional-formatting rule may recalculate and display a different color or icon. The appearance is driven by the rule; review the rule and rerun the sort if you need the rows regrouped.
  • Some rows stay outside the sort: Look for blank rows, blank columns, or data beyond the selected range. Select the complete range deliberately, or use a table to define the list’s boundaries.

Color display can also be difficult to distinguish for some readers or when printed in grayscale. If the color identifies important information, include a text label such as Urgent or Complete as well. That gives readers another way to interpret the data and makes sorting criteria clearer.

Excel on Mac and in a browser

In Excel for Mac, the sorting workflow is also available through the Data tab and Sort dialog; the labels and layout can vary somewhat by Excel release. Look for Sort by, Sort On, and Order, and verify that the dialog offers the color or icon option you need. On a Mac, the common undo shortcut is Command+Z rather than Ctrl+Z.

Excel for the web has sorting and filtering controls, but interface details and available options can differ from the Windows desktop app and may change over time. If you cannot find a color-based sort option in your browser version, open the workbook in the desktop Excel app and use Data > Sort. Sorting by a text status column is also a reliable alternative when you need the same result across different versions.

Frequently Asked Questions

Can Excel sort by color automatically?
Excel can apply the sort you choose, but it does not automatically know what each color means or continuously maintain a color-based order after every change. If formatting changes, run the sort again. For ongoing workflows, sort by an explicit status or priority value.

Can I sort by more than one color?
Yes. In Data > Sort, use Add Level to specify additional colors and their positions. Set the levels in the order you want them applied, and add a cell-values level if you also want to order records within each color group.

Can I sort by a color created with conditional formatting?
Yes, use the Sort On option that matches the result: Cell Color for conditional fill, Font Color for colored text, or Conditional Formatting Icon for an icon set. If the rule’s result changes, sort again to regroup the rows.

Can I sort by color without changing the data?
Sorting does not change the cell contents or colors, but it does change row order. If you want to leave the full list in place and look at just one color group, use Filter by Color instead.

Why is Sort by Color unavailable or giving the wrong result?
Check that the selected column contains the color, that you chose the matching sort feature, and that the full data range is included. If the color is conditional formatting, verify the rule and its displayed result; if the option is not available in your Excel version, try desktop Excel or sort by a text category.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Formulas & functions

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.