When your Excel data contains related rows, sorting one column at a time can create confusion about which field should control the final order. Many users need to sort records by multiple columns, such as organizing employees by department and then by name, but are unsure how to set the priority without mixing data.
To sort multiple columns in Excel, open the Data tab, select your full dataset, choose Sort to open the Sort dialog box, set the first column in the Sort by dropdown, then add additional columns with the Add Level button. Excel applies the first sort level as the main priority and uses later levels only to organize records that share the same value in earlier levels.
Sort multiple columns in Excel with the Sort dialog
The Sort dialog box is the safest method when you need to sort by two columns in Excel because it lets you define the exact priority order. Instead of clicking a single column sort button, you can tell Excel which column controls the grouping and which columns refine the order inside those groups.
Start by selecting the complete data range. Include every column that belongs to the same record, not only the columns you want to display in the final order. If a row contains an employee name, department, date, and status, all four columns should move together during the sort.

Use this setup checklist before running the sort:
- Select the entire dataset, including all related columns that form each record.
- Open the Data tab and click Sort to launch the Sort dialog box.
- Confirm that the My data has headers option matches whether the first row contains column headers.
- Set the Sort by dropdown to the primary column and choose ascending order or descending order.
- Click Add Level and use the Then by dropdown for each additional sorting rule.
For example, to sort a staff list by department and then employee name:
- Set Sort by to Department and choose A to Z.
- Click Add Level.
- Set Then by to Employee Name and choose A to Z.
- Run the sort and review the grouped results.
The result is a list where departments are grouped first, and names are arranged alphabetically inside each department.
The most common mistake is selecting only one column before sorting. If Excel detects that adjacent data exists, it may show the sort warning asking whether to expand the selection. Choose the option that keeps the full data range together unless you intentionally want to sort only one isolated column.
Understand Excel multi-level sorting priority
A multi-level sort means Excel applies several sorting rules in a specific order. The first level has the highest priority, while later levels act as tie-breakers inside groups created by earlier levels.
A useful way to think about the order is:
- Apply the first sort level to create the main groups across the dataset.
- Apply the second sort level only inside records that share the same value in the first level.
- Add further levels when records inside existing groups still need more organization.
For example, if you sort by Department first and Employee Name second, Excel does not alphabetize the entire worksheet by employee name. It creates department groups first, then sorts names within each group.
This priority system explains why adding a second level sometimes appears to do nothing. If every value in the first column is unique, the second level has no groups to reorganize. A later sort level only affects records that match on the levels above it.
Column headers and cell values also affect the result. Headers are labels for identifying fields, while the actual cell values determine the sorting order. If Excel mistakes a header row for normal data, the header may move during sorting or appear in the wrong position.
Choose the right sorting method for your dataset
The best sorting method depends on whether you need a quick change, a repeatable organization method, or a non-standard order. Choosing the wrong approach often creates extra work because a simple sort cannot handle multiple priorities, while a custom sort may be unnecessary for a one-time task.
Table of Sorting Methods
| Method | Best use case | Main advantage | Limitation |
|---|---|---|---|
| Single-column sort | Quick one-off ordering of a list by one field | Fast to apply from the Data tab | Cannot organize records by multiple priorities |
| Multi-level sort (Sort dialog) | Records need hierarchy, such as department then name | Keeps related rows organized by priority rules | Requires setting levels manually |
| Custom sort (custom list) | Data needs a fixed sequence instead of alphabetical order | Supports predefined category order | Requires creating or selecting a custom list |

Standard sort versus multi-level sort use cases
Use a standard sort when one column determines the entire result. For example, sorting a list of invoices by date from newest to oldest does not require additional levels if no other grouping matters.
Use an Excel multi-level sort when the dataset has a hierarchy. A department directory, inventory list, or project tracker usually needs a primary category and one or more secondary fields.
For repeated workflows, use the multi-level Sort dialog rather than a single-column quick sort, and keep a written checklist of the exact levels, for example: Department, then Employee Name, then Due Date, so every user applies the same three-level priority order each time the report is refreshed.
Custom lists for non-alphabetical ordering
Custom sorting is useful when Excel’s default alphabetical or numerical order does not match your business order. For example, a project status list might need to appear as High Priority, Medium Priority, Low Priority instead of alphabetical order.
Create or select a custom list, then apply it as the sorting order in the Sort dialog box. This approach is different from a normal multi-column sort because the main challenge is not priority between columns; it is defining the correct sequence inside one column.
Apply multi-column sorting to workplace records
Workplace datasets often combine categories, names, dates, and status fields. Sorting multiple columns works best when you decide the priority before opening Excel’s sorting tools.
A common example is a staff list containing Department and Employee Name columns. The goal is to group employees by department and then arrange names within each group.
Situation: A staff list contains a Department column and an Employee Name column, but employees are currently listed without a consistent order.
Steps:
- Select the complete staff table, including Department, Employee Name, and any other related fields.
- Open the Sort dialog from the Data tab.
- Set Sort by to Department with A to Z order.
- Select Add Level and set Then by to Employee Name with A to Z order.
- Run the sort and inspect several rows.

Result: Employees are grouped by department, and names inside each department appear alphabetically.
Note: If the table also contains a manager or job title field, add another level after the name field. The new level will only organize rows that still match the earlier sorting rules.
You can also sort dates with different priorities. For example, a project tracker may use Department as the first level, Status as the second level, and Due Date as the third level. The first level creates the main groups; later levels refine the arrangement.
Fix common problems after sorting multiple columns
Most sorting errors come from incorrect range selection, header detection, or inconsistent cell values. A correct multi-column sort depends on moving complete records together and confirming that the sort rules match the intended priority.
A safer verification process is:
- Select the complete data range, including every column connected to each record.
- Confirm the My data has headers setting matches the actual first row.
- Check that Sort by and Then by fields point to the intended columns before applying the sort.
- Compare several rows after sorting to confirm related values still belong together.
- Compare the number of rows before and after sorting to check that no records disappeared.
Prevent row misalignment and missing data issues
Row misalignment usually happens when only part of a dataset is sorted. The visible sign is that information that should belong together no longer matches, such as an employee name appearing with the wrong department or date.
To prevent this issue, always select the full table before sorting. If Excel displays the sort warning, choose the option that expands the selection when all columns belong to the same records.
Missing headers create another common problem. If the header row is sorted as normal data, column titles may move into the middle of the dataset. Check the Sort dialog box and confirm the header option before applying the sort.
Resolve incorrect sort results
Unexpected order can also come from mixed cell values. A column containing numbers stored as text may sort differently from numbers stored as numeric values. A date column with inconsistent formats can create a similar problem.
When the result looks wrong, check the observable signs first:
- If headers move, verify the header setting.
- If similar values appear separated, check whether cells contain different formats or hidden spaces.
- If the order is reversed, confirm whether ascending order or descending order was selected.
- If the previous arrangement was correct, use Undo immediately after the incorrect sort before making other workbook changes.
Use advanced sorting options when basic sorting is limited
Some datasets require more control than simple ascending or descending order. Excel provides additional sorting options for cases where the order depends on appearance or special rules.
Sort by color can organize highlighted records when formatting carries meaning, such as reviewing manually flagged items. This method sorts based on visual formatting rather than the actual cell value.
A case sensitive sort can separate values based on capitalization differences. This is useful only when capitalization represents a meaningful distinction in the dataset.
Keyboard shortcuts can speed up repeated workflows, but the Sort dialog remains the better choice when multiple priorities matter because it makes the level order visible before the change is applied.
When you regularly repeat the same multi-column sorting workflow, save the workbook with clearly labeled columns and consistent data structure. A repeatable setup reduces the chance of applying the wrong sorting level later.
Open one of your Excel tables today, select the full dataset, and create a two-level sort using the Sort dialog; this will show exactly how primary and secondary priorities affect your records while confirming that related rows stay together.
FAQ
What is the difference between sorting and filtering in Excel?
Sorting changes the order of records based on selected columns, while filtering limits which records are displayed. Multi-column sorting uses priority levels to organize the full dataset, such as grouping by department and then arranging names inside each group.
Can Excel sort multiple columns in different orders?
Yes. Excel can sort multiple columns using different orders by setting each level in the Sort dialog box. For example, you can sort one column from A to Z and add another level that uses a different sorting direction for records that share the same first-level value.
How do you add more sort levels in Excel?
Open the Sort dialog box from the Data tab, set your first sorting rule, then click Add Level to create additional Then by rules. Each added level works as a tie-breaker and only affects records that match the values in the earlier sort levels.
Can you undo a multi-column sort in Excel?
Yes. If a multi-column sort produces an incorrect result, use Undo immediately after the sort before making other workbook changes. Reviewing the data range and sort settings first can also help prevent unwanted changes.

