How to Sort Data in Excel

How to Sort Data in Excel

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:

Step-by-Step: Basic Sorting

The fastest way to sort a single column:

  1. Click any cell in the column you want to sort.
  2. Go to the Data tab.
  3. 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.

  1. Select your data range (or click inside a Table).
  2. Go to Data > Sort.
  3. In the Sort dialog, set:
    • Column: Region
    • Sort On: Values
    • Order: A to Z
  4. Click Add Level.
  5. Set the second level:
    • Column: Revenue
    • Order: Largest to Smallest
  6. 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:

  1. Go to Data > Sort.
  2. Under “Sort On,” choose Cell Color, Font Color, or Cell Icon.
  3. 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:

  1. Select your data range.
  2. Go to Data > Sort.
  3. Click Options in the Sort dialog.
  4. Choose Sort left to right.
  5. 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:

  1. Go to Data > Sort.
  2. Under “Order,” choose Custom List.
  3. 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.
  4. 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.

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:

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

Troubleshooting Tips

Real-World Use Cases

Best Practices I Follow

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.

Exit mobile version