MS Excel - Excel Sort
1. What is Sorting in Excel?
Sorting in Excel helps you organize data in a specific order — either alphabetical, numerical, date-based, or even by color.
2. Basic Sorting (One Column)
Steps:
-
Select any cell in the column you want to sort.
-
Go to Home → Editing → Sort & Filter or Data → Sort & Filter.
-
Choose:
-
Sort A → Z → Ascending (A-Z, smallest to largest, oldest to newest).
-
Sort Z → A → Descending (Z-A, largest to smallest, newest to oldest).
-
Shortcut:
-
Alt + D + S → Opens Sort Dialog Box.
-
Alt + H + S + S → Sort ascending.
-
Alt + H + S + O → Sort descending.
3. Custom Sorting (Advanced Options)
If you want to sort multiple columns or custom orders:
Steps:
-
Select your dataset.
-
Go to Data → Sort → Click Custom Sort.
-
In the Sort dialog:
-
Choose the column.
-
Choose Sort On:
-
Values (default)
-
Cell Color
-
Font Color
-
Cell Icon.
-
-
Choose Order:
-
A-Z / Z-A
-
Smallest → Largest
-
Oldest → Newest
-
Custom List.
-
-
4. Multi-Level Sorting
You can sort by multiple columns.
Example:
Sort by Department first, then Employee Name.
Steps:
-
Go to Data → Sort → Custom Sort.
-
Click Add Level.
-
Select:
-
First level → Sort by Department (A-Z).
-
Second level → Then by Employee Name (A-Z).
-
-
Click OK.
5. Sorting by Color
You can sort by cell color, font color, or conditional formatting icons.
Steps:
-
Select your range.
-
Go to Data → Sort → Custom Sort.
-
Under Sort On, select:
-
Cell Color → Sorts cells with a specific background color first.
-
Font Color → Sorts cells based on text color.
-
Cell Icon → Sorts based on conditional formatting icons.
-
6. Sorting Dates
Excel sorts dates chronologically.
Steps:
-
Select your column of dates.
-
Go to Data → Sort.
-
Choose:
-
Oldest to Newest
-
Newest to Oldest.
-
Tip: If dates don’t sort correctly, ensure the cells are formatted as Date (Ctrl+1 → Number → Date).
7. Sorting with a Custom List
If you want Excel to sort in a specific order, e.g.:
Example: Sort months as
Jan → Feb → Mar → Apr (not alphabetically).
Steps:
-
Go to Data → Sort → Custom Sort.
-
Choose column.
-
Under Order, choose Custom List.
-
Select built-in lists (e.g., days, months) or create your own.
8. Sorting Using Formulas (Dynamic Sorting)
If you want automatically sorted lists without using the Data menu, use formulas.
(Excel 365 / Excel 2021 or later)
Formula Example 1: Sort Numbers
=SORT(A2:A10)
-
Sorts the range A2:A10 ascending.
Formula Example 2: Sort Descending
=SORT(A2:A10,,-1)
-
-1
= descending order.
Formula Example 3: Sort by Another Column
=SORT(A2:B10,2,1)
-
Sorts A2:B10 based on the 2nd column, ascending.
9. Sort vs. Filter
-
Sort → Rearranges all rows based on your criteria.
-
Filter → Hides rows temporarily without rearranging them.
Shortcut to open Filter:
Ctrl + Shift + L
10. Excel Sorting Shortcuts
Action | Shortcut |
---|---|
Open Sort Dialog | Alt + D + S |
Sort Ascending (A→Z) | Alt + H + S + S |
Sort Descending (Z→A) | Alt + H + S + O |
Apply/Remove Filter | Ctrl + Shift + L |
Open Custom Sort Dialog | Alt + A + S + S |
11. Tips for Better Sorting
-
Always select entire table, not just one column — to avoid data mismatches.
-
Remove merged cells before sorting — they cause errors.
-
Convert data into a Table (Ctrl + T) for easier sorting & filtering.
-
Use Custom Lists for non-standard sequences.
-
Use SORT() formula for dynamic sorting in dashboards.