Sort Excel by Color: Steps, Options, and Troubleshooting

Formulas & functions · Updated November 2, 2026

Sort Excel by Color: Steps, Options, and Troubleshooting

To sort an Excel sheet by color in Microsoft 365 for Windows, select a cell in your data, go to Data > Sort, choose the column under Sort by, set Sort On to Cell Color, then choose the color and whether it should appear On Top or On Bottom. Click Add Level to place another color in a chosen order, then click OK; Excel moves the entire matching rows, not just the colored cells.

What sorting by color does

A color sort uses the formatting in one column as a sorting key. For example, if a Status column contains green, yellow, and red fills, you can bring all green rows to the top and put the others below. The entries within each color group retain their relative order unless you add another sort level to arrange them by a value such as date or name.

Excel can sort by cell fill color, font color, or a conditional-formatting icon when that formatting is present in the selected data. It does not infer what a color means. A red fill might mean overdue in one workbook and high priority in another, so the sort simply groups matching formatting; it does not interpret labels, rules, or business meaning.

Sorting is also different from changing the colors. The sort rearranges rows while leaving each row’s contents together. It does not recolor cells, remove formatting, or create a permanent category field. If you need a reliable, repeatable order based on meaning rather than appearance, a text or numeric status column is usually a better key.

How to sort a range by color

  1. Click a cell inside the data. Check that the rows form one continuous range, with a header row if the data has headings. Avoid selecting only the colored cells: the goal is to sort complete records.
  2. On the ribbon, choose Data > Sort. In the Sort dialog, check that My data has headers is selected if the first row contains column names. If Excel has not identified the header correctly, set this option yourself.
  3. In Sort by, choose the column whose colors you want to use. Under Sort On, choose Cell Color. Choose the desired fill in the Order color menu, then choose On Top or On Bottom.
  4. Click OK to apply the sort. If you want more than one color group, reopen Data > Sort, click Add Level, and specify the next color. Use the level order to control which color group comes first.

For instance, imagine a tracker with red, yellow, and green fills in column C. To show red records first and green records last, create one level for the red cell color set to On Top, then add levels for yellow and green in the order you want. Excel places each selected color group according to its level. If colors are missing from the Order menu, confirm that the chosen column actually contains those colors within the range being sorted.

Excel may ask whether to Expand the selection or Continue with the current selection if you selected only part of the data. Choose Expand the selection so names, dates, and other fields move with their matching color-coded cells. Sorting a single column alone can scramble the relationship between fields in a record.

Put several colors in a deliberate order

A single color rule places one color at the top or bottom; it does not define a complete custom sequence for every possible color. To specify a sequence such as red, then yellow, then green, use multiple sort levels. In the Sort dialog, click Add Level for each additional color and choose the same color-bearing column for each level. Set the color and position at each level, then review the listed levels before applying the sort.

You can also combine a color level with a value sort. For example, put red-filled tasks at the top, then sort those tasks by due date from oldest to newest. Add a level using the Due Date column and choose Values under Sort On. The color criterion groups the records first; the date criterion orders records within that group. Additional levels can sort ties by another column, such as owner or project name.

If you need a different rule for every color and want precise control, a helper column can be easier to maintain. Enter a category or priority number for each row, such as 1 for urgent, 2 for review, and 3 for routine, then sort by that field. This keeps the ordering explicit and makes it easier for colleagues to understand why one group appears before another.

Sort, filter, or find a color?

Sorting by color changes the order of the rows and keeps all records visible. Filtering by color hides rows that do not match a chosen color, without changing the order of the remaining rows. If you only need to review urgent items temporarily, filtering may be less disruptive. With a standard filter, open the column’s filter menu and use the color options if they are available for that column.

Finding a color is different again. Find and Replace can search for formatting, but finding a cell does not organize the full list. Use a sort when you want colored records grouped in the sheet, a filter when you want to display only one group, and a formatting search when you want to locate particular cells without rearranging the data.

These options do not make color a dependable data category by itself. A reader may have difficulty distinguishing similar shades, and printed or copied versions can display colors differently. Include a text label such as Urgent, Review, or Complete alongside meaningful colors, particularly when the workbook is shared or used for decisions.

Cell fills, font colors, and conditional formatting

For a background fill, choose Cell Color in Sort On. To group text by its color instead, choose Font Color. If the column uses icon sets from conditional formatting, choose Cell Icon when that option is available, then select the icon and its position. These settings are all in the Sort dialog; the relevant choices appear according to the formatting found in the selected column.

Conditional formatting can make a cell look colored even when the fill was not manually applied. Excel can sort by displayed conditional-formatting colors in supported desktop versions, but check the outcome carefully: the formatting rule may calculate from values, formulas, or row position. When a sort changes positions, a formula-based rule can recalculate and show different colors. The displayed grouping may then change because the color is a result of the rule rather than a fixed label.

For example, suppose a rule colors a cell green when its value is at least 80 and red when it is below 80. Sorting by the displayed fill groups the current qualifying values, but changing a value later can move that row into a different color group when you sort again. If the color depends on a formula involving relative references, verify that the rule applies to the intended range and that the formula references still make sense after records move.

Protect the integrity of your data

Before sorting, inspect the range boundaries. A blank row or blank column can make Excel treat part of a table as a separate block. If a record extends beyond the range Excel identifies, some fields might not move with the rest. Include every column that belongs to the record, and avoid sorting a subsection of a larger table unless separating it is intentional.

Excel tables are useful for ongoing lists because their headers and rows form a defined structure. Click inside the table and use the Data sort controls; sorting a table rearranges its complete data rows. For a normal range, use the selection prompt carefully and choose to expand the selection when needed. If the workbook contains merged cells in the area, sorting may be unavailable or may require changing the layout first.

Save a copy or confirm that the workbook has a recent saved version before a complicated rearrangement. You can usually reverse a normal sort immediately with Undo, but later edits or other actions can make that harder. For an audit-sensitive list, keep a stable ID column so each record can be checked after sorting. A unique identifier helps confirm that a name, date, and status stayed on the same row.

Common problems and how to fix them

  • The wrong rows moved: Undo immediately, then repeat the sort and choose Expand the selection. Check that every related field is inside the selected range.
  • The color is not listed: Make sure Sort by points to the column with the color, and that the cells in the sort range actually use that fill, font color, or icon. A similar-looking shade may be a different color value.
  • Some rows appear in an unexpected group: Check for cells with no fill, manually applied formatting that differs slightly, or conditional formatting that recalculates. Also confirm the order of the levels in the Sort dialog.
  • The sort seems to have no effect: Verify that the selected range includes more than one color group and that the Sort On setting is Cell Color, Font Color, or Cell Icon rather than Values.
  • Colors change after sorting: Review conditional-formatting rules and formulas. If color is intended to represent a fixed status, store that status as a value and use formatting only as a visual cue.

When Excel detects headers, the header row should remain at the top rather than being treated as a record. If a heading is accidentally included as data, reopen the dialog and correct My data has headers. Also check that the chosen column has a header that accurately identifies it; this makes the sort easier to review and reduces the chance of selecting the wrong field.

Excel for Mac and Excel for the web

On Excel for Mac, the general approach is the same: select the data, open the Data tab’s Sort controls, choose the column and a color-based Sort On option, then set the color’s position. Ribbon layout and dialog labels can vary somewhat by release. Follow the options shown in the Sort dialog rather than relying on Windows-specific keyboard sequences.

Excel for the web has a more compact interface, and available sorting options can vary with the workbook and current feature set. Look under the Data tab for Sort and check whether the dialog offers sorting by cell color, font color, or icon. If the needed option is absent, open the workbook in the desktop Excel app for Microsoft 365 and perform the custom sort there. Saving changes in a shared workbook can affect what other collaborators see, so coordinate before changing the row order of a list others are editing.

Frequently Asked Questions

Can Excel sort by cell color automatically?
Excel can apply a color sort when you request it, but it does not continuously keep rows ordered as colors change. Run the sort again after changing colors or values. If you need a durable automatic order, use a status or priority column and sort by its values.

Can I sort by more than one color?
Yes. Open Data > Sort, click Add Level, and add a color rule for each group you want to position. Set the levels in the order you want Excel to apply them, and verify the result after sorting.

Will sorting by color keep each row together?
Yes, provided Excel sorts the complete data range or table. If prompted, choose Expand the selection. Sorting only the colored column can separate values from the names or other information that belongs with them.

Can I sort by colors made with conditional formatting?
In supported Excel versions, the Sort dialog can sort by the displayed cell color or icon. Because conditional formatting can recalculate when values or positions change, inspect the rules and confirm that the resulting groups still represent what you intend.

How do I return the sheet to its original order?
Use Undo immediately after the sort if no later action has replaced the undo history. Otherwise, sort by a saved original-order or ID column if you created one. Excel does not generally provide a permanent record of the former row order just because you sorted by color.

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.