How to Do Advanced Sorting in Excel (4 Different Examples)

Sorting is one of the most common tasks in Excel when dealing with data. The basic sort option lets you simply arrange values in ascending or descending order. Sometimes, though, you need more control. For example, you might want to organize records by more than one column, apply a custom order, or sort based on cell color or font color.

This is where Advanced Sorting in Excel becomes useful. It helps you structure data in a way that highlights key information and makes your reports easier to understand.

In this article, we’ll learn how to use advanced sorting in Excel step by step with practical examples.

Key Takeaways

Here’s how to use advanced sorting in Excel with multiple levels:

➤ Open your dataset in Excel.
➤ Select the dataset range A1:C11.
➤ Go to the Data tab on the Ribbon and click on Sort in the Sort & Filter group.
➤ The Sort dialog box will appear. In the first Sort by dropdown, select Department. In the Order dropdown, choose A to Z so departments appear alphabetically.
➤ Now click on Add Level. In the new Then by dropdown, choose Salary. In the Order dropdown, select Largest to Smallest so higher salaries come first.
➤ Click OK to apply the sorting.
➤ Your dataset will now be organized by the Department in alphabetical order. Within each department, employees will be listed according to their salaries, with the highest earners at the top.

overview image

Download Practice Workbook
1

Sort by Multiple Columns in Excel

In the following dataset, we have a small employee table with 10 rows. Column A lists Employee Names, Column B shows the Department, and Column C contains the Salary.

Sort by Multiple Columns in Excel

We’ll use this dataset to demonstrate different ways of advanced sorting in Excel.

In many situations, sorting by a single column is not enough. For example, you may want to organize employees by their department first and then arrange their salaries within each department. This is where sorting by multiple columns helps.

Here’s how to apply it step by step:

➤ Open your dataset in Excel.
➤ Select the dataset range A1:C11.
➤ Go to the Data tab on the Ribbon and click on Sort in the Sort & Filter group.

Sort by Multiple Columns in Excel

➤ The Sort dialog box will appear. In the first Sort by dropdown, select Department. In the Order dropdown, choose A to Z so departments appear alphabetically.

Sort by Multiple Columns in Excel

➤ Now click on Add Level. In the new Then by dropdown, choose Salary. In the Order dropdown, select Largest to Smallest so higher salaries come first.
➤ Click OK to apply the sorting.

Sort by Multiple Columns in Excel

➤ Your dataset will now be organized by the Department in alphabetical order. Within each department, employees will be listed according to their salaries, with the highest earners at the top.

Explanation
By adding levels in the Sort dialog box, Excel sorts the data in stages. First, it arranges rows by Department. Then, within each department group, it sorts again based on Salary. This layered sorting gives you a much clearer view of your dataset compared to a simple one-column sort.

Sort by Multiple Columns in Excel


2

Sort Using Custom Lists in Excel

Excel normally sorts text alphabetically, which works in most cases. But sometimes you need a specific order that does not follow the alphabet. For example, you might want to see all employees in Finance first, then HR, and finally IT. This is not possible with a normal A to Z sort, but you can do it with a custom list.

Here’s how to apply it step by step:

➤ Open your dataset in Excel.
➤ Select the dataset range A1:C11.
➤ Go to the Data tab on the Ribbon and click Sort in the Sort & Filter group.

Sort Using Custom Lists in Excel

➤ In the Sort dialog box, choose Department in the Sort by dropdown.
➤ In the Order dropdown, select Custom List.

Sort Using Custom Lists in Excel

➤ The Custom Lists dialog box will appear. In the List entries box, type Finance, HR, IT in the exact order you want them sorted.
➤ Then click Add and press OK.

Sort Using Custom Lists in Excel

➤ Back in the Sort dialog box, press OK again to apply the custom order.

Sort Using Custom Lists in Excel

➤ Now your dataset will display all Finance employees first, followed by HR employees, and then IT employees, regardless of alphabetical order.

Explanation
A custom list overrides Excel’s default sorting rules. Instead of sorting alphabetically, it follows the order you specify. This is especially useful when working with data like months (Jan, Feb, Mar), regions (North, South, East, West), or any business-specific categories like (Finance, HR, IT) where alphabetical order does not make sense.

Sort Using Custom Lists in Excel


3

Sort by Cell Color or Font Color in Excel

Sometimes data is highlighted with different colors to make it easier to review. For example, salaries above $60,000 might be highlighted in green, or specific employees may be marked in red. With advanced sorting, you can bring these highlighted rows to the top or push them to the bottom of your dataset.

In this method, we have highlighted salaries above $60,000 in green in our dataset. We’ll now use advanced sorting to bring those rows to the top.

Sort by Cell Color or Font Color in Excel

Here’s how to apply it step by step:

➤ Open your dataset in Excel.
➤ Select the dataset range A1:C11.
➤ Go to the Data tab and click Sort.

Sort by Cell Color or Font Color in Excel

➤ In the Sort dialog box, choose the column where the colors are applied. For example, select Salary if you highlighted high salaries with a cell color.
➤ In the Sort On dropdown, change the option from Values to Cell Color or Font Color.

Sort by Cell Color or Font Color in Excel

➤ A new dropdown No Cell Color will appear to let you choose which color you want to sort by. Pick the color you used. For example, choose green.

Sort by Cell Color or Font Color in Excel

➤ In the Order dropdown, decide if you want rows with that color to appear On Top or On Bottom. For example, select On Top.
➤ Press OK to complete the sorting.

Sort by Cell Color or Font Color in Excel

➤ Now your dataset will show all highlighted rows grouped together, making them easier to review.

Explanation
This feature is useful when reports use colors for emphasis, such as conditional formatting for high and low values. Instead of scanning the sheet manually, sorting by color brings important data into view instantly.


4

Sort by Values with a Custom Rule in Excel

Sometimes you don’t just want to sort numbers in ascending or descending order. Instead, you may want to group them into categories such as High, Medium, and Low. Excel doesn’t have this grouping by default, but you can create it with a helper column and then apply advanced sorting.

First, insert a new column next to Salary and name it Salary Group.

Sort by Values with a Custom Rule in Excel

Here’s how to apply it step by step:

➤ Open your dataset in Excel.
➤ In cell D2, enter the following formula to categorize salaries:

=IF(C2>=65000,"High",IF(C2>=55000,"Medium","Low"))

Sort by Values with a Custom Rule in Excel

➤ Press Enter, then drag the fill handle down to apply the formula to the rest of the rows. Each employee will now have a salary group of High, Medium, or Low.

Sort by Values with a Custom Rule in Excel

➤ Select the dataset range A1:D11.
➤ Go to the Data tab and click Sort.

Sort by Values with a Custom Rule in Excel

➤ In the Sort dialog box, choose Salary Group as the column to sort by.
➤ In the Order dropdown, click Custom List.

Sort by Values with a Custom Rule in Excel

➤ In the Custom Lists dialog box, type High, Medium, Low in the order you want. Then click Add and press OK.

Sort by Values with a Custom Rule in Excel

➤ Press OK again to apply the sorting.

Sort by Values with a Custom Rule in Excel

➤ Your dataset will now display all High-salary employees first, followed by Medium, and then Low.

Explanation
By creating a helper column, you can define your own sorting logic instead of relying only on Excel’s built-in ascending or descending options. Using a custom list ensures that the order follows your business needs, such as grouping sales into regions, grading students by performance, or categorizing expenses.

Sort by Values with a Custom Rule in Excel


Frequently Asked Questions

What is advanced sorting in Excel?

Advanced sorting lets you organize data in more flexible ways compared to the basic sort feature. You can sort by multiple columns, apply custom lists, or arrange rows based on cell color, font color, or custom rules.

How to get an advanced Sort in Excel?

You can access advanced sort by going to the Data tab and clicking on Sort in the Sort & Filter group. This opens the Sort dialog box, where you can add multiple levels, use custom lists, or sort by colors.

How to sort data in Excel in ascending or descending order?

Select the column you want to sort, go to the Data tab, and click either the A to Z button for ascending order or the Z to A button for descending order. For more control, you can open the Sort dialog box and choose the order directly.


Wrapping Up

Advanced sorting in Excel makes it easier to arrange data in meaningful ways. You can sort by multiple columns, create your own custom lists, or even organize rows based on colors or categories. These options give you more control over how your information is displayed and help you analyze patterns quickly.

Once you start using advanced sorting, you’ll find it much easier to manage larger datasets and highlight the exact details you need for reports or decision-making.

ExcelInsider Team
We will be happy to hear your thoughts

Leave a reply

Excel Insider
Logo