In this tutorial, you will learn how to sort highlighted cells by color in Excel and Google Sheets.
Sort by Color
- Click anywhere in the data range, and in the Ribbon, go to Home > Sort & Filter > Custom Sort…
- 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.
The data range is now sorted by color.
Sort by Color in Google Sheets
- To sort by color in Google Sheets, first click anywhere in the data range then click on the filter button in the toolbar.
- 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.
After this, rows colored in red are sorted at the top of the data range.
- Now repeat Step 2 for yellow and green, in that order.
The final output is the same as in Excel: The data range is sorted by color as ordered.