How to Sort by Color in Excel

A while back, I attended a conference where an industry expert strongly urged participants not to use color in a Microsoft Excel spreadsheet. She claimed you couldn’t sort columns by color. She went on to say one of her clients had done this, and she spent hours fixing the spreadsheet. Sorry, but sometimes experts are wrong. In this tutorial, I’ll show you how to sort by color in Excel or filter.

Why Use Color

Perhaps, at one time, color sorting and filtering weren’t available, but you can do it now. The tutorial below can be used for font colors or cell colors. For these instructions, I’ll be using Microsoft Office 365. However, these steps can be used in older Excel versions.

It’s probably my laziness, but changing a cell’s background color is useful. I might use this when I’m prioritizing or grouping a list. All I need to do is highlight a cell and choose a background color.

I’ve already built a sample spreadsheet with some values and colored cells. Please don’t put any value in the data as it’s fictional. I used a keyword generator and Excel’s randbetween function.

Sample Excel sheet with some colored background cells.
Sample worksheet with background cell colors

I’ve applied the cell background color to Column C in my screen snap above. However, some people might prefer using color across a row. In the second screenshot below, I used Excel conditional formatting. The process is the same regardless of whether you’re using columns or rows. It also works with Excel tables.

Excel spreadsheet with row with background color.
Spreadsheet with color based on conditional formatting

How to Sort by Cell Color

  1. Open your spreadsheet and click the Data tab.
  2. Highlight your data range. You can also click CTRL + A.
  3. Click the Sort button.
Excel Sort dialog overlaying highlighted range.
Excel Sort dialog box
  1. Tick the My data has headers checkbox in the top-right if your worksheet uses them.
  2. Click the drop-down arrow next to Sort by and select the column label with your color. This custom sort uses colors instead of a numeric or text cell value.
  3. Move to the right and click the drop-down arrow for Sort On values.
Excel Sort On with Cell Color in menu.
Excel Sort On options
  1. From the drop-down list, select Cell Color. Excel will show the colors you used from the spreadsheet including “No cell color”.
Sort dialog with spreadsheet colors showing in order column.
Excel predetermines the colors used
  1. Select your first fill color and keep the Order value as On Top.
  2. Click the Add Level button in the top left of the panel. This will add another sort order rule.
  3. Add in your other color levels. If you prefer, you can also use the On Bottom option.
Excel Sort showing color order sort.
Multi-color rule sort
  1. Click OK.

You should now see your sorted list by color. You’re not limited to just 3 colors; you can keep adding if they’re on your sheet. You also don’t need to enter the last color, as Excel will put it on the bottom. In my case, that was “No Cell Color.”

Final Excel sheet sorted by cell color column.
Excel spreadsheet sorted by color rule order

The same process works if you wish to sort by font color.

How to Filter by Color in Excel

Some people prefer to filter instead of sort. This is great if you want to focus on certain items. Even better, the procedure is shorter.

  1. Open your spreadsheet.
  2. Select the column you wish to filter that has color.
  3. From the Sort & Filter group, click the Filter button. You should see a small drop-down arrow in the top-right corner of your column heading.
  4. Click the down-down arrow.
Excel Filter by Color menu with just cell color option.
Excel filter by color options
  1. Select your cell color from the side menu.

In my example, I was using a background color. However, when I added colored text, Excel adjusted the options. On the side menu for Filter by Color, you would also see Filter by Font Color.

Additional Excel Filter by Font Color option with my blue font color.
You can filter cells by background color or font color

Quick Takeaways

  • Excel allows you to sort and filter by color
  • The color can be either the cell background color or the font color
  • You can place colors on top or bottom
  • The system knows which colors you’ve used
  • No cell color is for normal cells
  • You can add multiple color sorts
  • Sort rules are processed in order

The bottom line is don’t always believe everything experts tell you. And feel free to liven up Excel by filtering or sorting by color.