Sort by Color (Highlighted Cells) in Excel & Google Sheets

In this tutorial, you will learn how to sort highlighted cells by color in Excel and Google Sheets.

 

excel sort by color

 

Sort by Color

In Excel, you can sort a data range based on the cells’ fill color. Look at the following example to walk through sorting data by green, yellow, and red, in that order.

 

sort by color initial data

 

  1. Click anywhere in the data range, and in the Ribbon, go to Home > Sort & Filter > Custom Sort…

 

custom sort excel

 

  1. In the Sort window, choose any option under Column, choose Cell Color under Sort On, and select the first color (green for this example) under Order.
    Now click Add Level to add yellow and red with the same options as selected for green.

 

sort by color excel

 

The data range is now sorted by color.

 

data range sorted by color

 

Sort by Color in Google Sheets

  1. To sort by color in Google Sheets, first click anywhere in the data range then click on the filter button in the toolbar.

 

google sheets create filter

 

  1. When sorting by color, Google Sheets will automatically put rows with sorted color at the top. So in this case, you need to sort three times: first by red, then yellow, and finally green.
    Click on the filter button next to SKU (B2), go to Sort by color > Fill Color, and choose red.

 

google sheets sort by color

 

After this, rows colored in red are sorted at the top of the data range.

 

google sheets sort by color 2

 

  1. Now repeat Step 2 for yellow and green, in that order.

 

google sheets data sorted by color

 

The final output is the same as in Excel: The data range is sorted by color as ordered.