Sorting is one of the very first things I learned in Excel, and I still use it almost every single day. Whether I’m arranging a list of names alphabetically, ranking sales figures from highest to lowest, or organizing dates chronologically, sorting turns a messy jumble of rows into something readable and useful. In this article, I’ll show you every method I use to sort data in Excel, from the simplest one-click sort to multi-level custom sorting.
What Sorting Actually Does
Sorting physically rearranges the rows (or columns) in your spreadsheet based on the values in one or more columns. Unlike filtering, which just hides rows, sorting changes the actual order of your data. This is important to remember — if you sort a range that includes formulas referencing specific cells, you could accidentally break those references.
Preparing Your Data Before Sorting
Before I sort anything, I check a few things:
- Include headers. Excel usually detects a header row automatically, but I always confirm the “My data has headers” checkbox is ticked in the sort dialog.
- Select the full range, not just one column. If I only select one column and sort it, the rest of the row stays in place — which scrambles my data completely.
- No merged cells within the sort range, since Excel can’t sort merged cells properly.
- Consistent data types, so a “Date” column doesn’t mix actual dates with text like “N/A.”
Step-by-Step: Basic Sorting
The fastest way to sort a single column:
- Click any cell in the column you want to sort.
- Go to the Data tab.
- Click A→Z (ascending) or Z→A (descending) in the Sort & Filter group.
Excel automatically expands the selection to include the whole table, so your rows stay intact.
For numbers, A→Z sorts smallest to largest, and Z→A sorts largest to smallest. For dates, A→Z sorts oldest to newest.
Step-by-Step: Custom Multi-Level Sort
Often I need to sort by more than one column — for example, sorting sales data first by Region, and within each region, by Revenue from highest to lowest.
- Select your data range (or click inside a Table).
- Go to Data > Sort.
- In the Sort dialog, set:
- Column: Region
- Sort On: Values
- Order: A to Z
- Click Add Level.
- Set the second level:
- Column: Revenue
- Order: Largest to Smallest
- Click OK.
Now my data is grouped by region, and within each region, sorted by revenue. I can add as many levels as I need using the same “Add Level” button.
Sorting by Cell Color or Icon
If you’ve applied conditional formatting or manual highlighting, you can sort by color:
- Go to Data > Sort.
- Under “Sort On,” choose Cell Color, Font Color, or Cell Icon.
- Pick the specific color or icon and set whether it goes on top or bottom.
I use this when I’ve color-coded overdue invoices in red and want them grouped at the top of my sheet.
Sorting Left to Right (Columns Instead of Rows)
By default, Excel sorts top to bottom. If your data is arranged horizontally and you need to sort columns instead:
- Select your data range.
- Go to Data > Sort.
- Click Options in the Sort dialog.
- Choose Sort left to right.
- Click OK, then choose which row to sort by.
Custom Sort Order (Not Alphabetical)
Sometimes alphabetical order doesn’t make sense — for example, sorting days of the week (Monday, Tuesday, Wednesday…) or priority levels (High, Medium, Low). Here’s how I handle that:
- Go to Data > Sort.
- Under “Order,” choose Custom List.
- Either pick a built-in list (like days of the week or months) or click New List and type your own custom order, one item per line.
- Click Add, then OK.
This is one of the most underrated features in Excel — I use custom lists constantly for things like project status stages (Not Started, In Progress, Completed) that don’t sort correctly alphabetically.
Practical Example
Imagine I have a student results sheet with columns: Name, Class, and Marks. I want to group students by Class, and within each class, rank them from highest to lowest marks.
- First sort level: Class, A to Z.
- Second sort level: Marks, Largest to Smallest.
The result is a clean, class-wise ranked list — exactly what a teacher would need for report generation, without touching a single formula.
Formulas and Sorting: SORT and SORTBY Functions
If you’re using a newer version of Excel (Microsoft 365), you can sort dynamically using formulas instead of physically rearranging your data:
=SORT(A2:A10)— sorts the range in ascending order.=SORT(A2:B10, 2, -1)— sorts by the second column, descending.=SORTBY(A2:A10, B2:B10, -1)— sorts one range based on the values of another.
I like using SORT and SORTBY when I want a “live” sorted view without disturbing my original data — the sorted result updates automatically if the source data changes.
Common Mistakes I See
- Selecting only one column to sort, which misaligns the rest of the row and corrupts the data. Always sort the full range or use a Table.
- Sorting a range with formulas that reference specific cell addresses, which can produce wrong results after the rows move.
- Forgetting “My data has headers”, causing the header row to get sorted right into the middle of your data.
- Sorting merged cells, which Excel either blocks or handles unpredictably.
- Mixing text and numbers in a numeric column, so numbers stored as text sort separately from real numbers.
Troubleshooting Tips
- If sorting seems to scramble your data, undo immediately (Ctrl+Z) and check whether you selected the full range.
- If numbers aren’t sorting correctly, check their alignment — text-formatted numbers align left, real numbers align right.
- If dates sort strangely, confirm they’re actual date values, not text strings that look like dates.
- If a custom sort order isn’t showing up, make sure you saved it as a custom list under File > Options > Advanced > Edit Custom Lists.
Real-World Use Cases
- Teachers ranking student marks from highest to lowest.
- Sales managers sorting deals by revenue or closing date.
- HR teams sorting employee lists alphabetically or by joining date.
- Finance teams sorting expenses by category and amount.
- Event organizers sorting registration lists by date and time.
Best Practices I Follow
- Always work inside an Excel Table (Ctrl+T) — it keeps sorting consistent and prevents accidental partial selections.
- Use multi-level sorting instead of sorting one column, undoing, then sorting another — it’s faster and less error-prone.
- Save custom sort orders you use often (like status stages or priority levels) so you don’t have to retype them every time.
- Use SORT/SORTBY formulas when you want your source data to stay untouched but still see a sorted view.
- Double-check formulas after sorting, especially ones using absolute or relative references that assume a specific row order.
Sorting looks simple on the surface, but once you start combining multiple levels, custom lists, and dynamic SORT formulas, it becomes a genuinely powerful way to organize and present your data clearly — whether you’re building a report for your boss or just trying to make sense of your own spreadsheet.
