How to Sort by Color in Excel? (with Examples)
When a column or a data range in excel is formatted with colors either by using the conditional formatting or manually, when we use filter on the data excel provides us with an option to sort the data by color, there is also an option for advanced sort where user can enter different levels of color for sorting.
Example #1 – Column Sort
Recently I received a database from the Human Resources department. These include employee names and the designations in the company.
The problem here is they not mentioned designation against each employee rather they just highlight all the executives in one color, junior in one color and so on. And they asked my help to sort all executives one side, juniors one side, seniors one side.
Those days I was not the prolific user of the sort by color option. However, thanks to my seniors for just letting me know about the sort by color in excel early on in my career, even though I did not use it to the full extent I just knew there is an option called Sort by color in excel.
Below is the data I have received from the HR department.
Ok just looking at the outset I can understand light blue represents Senior, light green represents Junior, orange represents Executive, and dark blue represents Team Leaders.
Step 1: Select the entire data table from A1 to B22.
Step 2: Now go to Data Tab (ribbon) and select Sort. (You can press ALT + D + S)
Step 3: Once you click on Sort it will open up the below dialogue box.
Step 3.1: Once small check we need to do here i.e. make sure My data has headers checkbox is ticked.
Step 4: Under Sort by select the column that we need to sort. In this example, we need to sort the second column i.e. Designation.
Step 5: After this, we need to go to Sort On option. Under this select cell color.
Step 6: As soon as you select Cell color it will enable one more option called Order. This is simply in what order your colors should come on top. Select the color according to your wish. I have selected dark blue to come on top.
Step 7: Click the OK button, it will sort the data based on the color of the cell. One thing we need to notice here is it will only sort the required color all the other colored cells remain unchanged.
Note: To sort the same colors together we need to sort 4 times here. Each time we need to select each color one at a time.
Example #2 – Sort By Font Colour
We can sort the data based on cell color. Similarly, we can sort the data based on the Font Color too.
Look at the below data I have the Product list region-wise. Each region’s name of the font is colored differently. I need to sort the data based on the font color.
Step 1: Select the data from A1 to B18.
Step 2: Open the Sort by pressing ALT + D + S.
Step 3: Select the column we want to sort. In my case, I have selected the Region column.
Step 4: Under Sort by option select the option Font Color.
Step 5: You can choose the priority of your color under the Order section. I have selected Green to come on top.
Step 6: Press the OK button. All the green-colored fonts will come on top, but all the other font colors remain the same.
Things to Remember
- It will sort only the selected color and all the other colored cells and fonts remain constant.
- It is important to select the My data has headers option to avoid sorting headers of the data as well.
- We can sort one color at a time.
- We can sort based on cell icons as well.
- We can a particular color to come on either to top or bottom.
- It is better to sort by alphabetic or numbers because it will sort all the group one side.
This has been a guide to Sort by Color in Excel. Here we discuss how to Sort by Color in Excel along with excel example and downloadable excel templates. You may also look at these useful functions in excel –
- Sum by Color in Excel
- Excel Database
- Apply Conditional Formatting in Pivot Table
- How to Use Conditional Formatting Based on Another Cell Value?
- Column Sort in Excel
- Sort by Number in Excel
- How to Highlight Every Other Row in Excel?
- How to Sort Data in Excel
- Format in Excel
- Conditional Formatting Tips