How to Sort Data in Excel
Sort Excel data alphabetically, numerically, by multiple columns, or by custom order. Covers the Sort button, the SORT function, and how to avoid the most common sorting mistake.
Excel gives you two ways to sort: the menu-based Sort tool (which sorts in-place and is permanent), and the SORT function (which outputs a sorted copy without touching your original data). Which to use depends on whether you need the sort to stay live as data changes.
Method 1: Sort button (in-place)
Step 1. Click any cell inside your data.
Step 2. Go to Data → Sort A to Z (ascending) or Sort Z to A (descending) for a quick single-column sort.
For more control, use Data → Sort to open the full dialog:
Step 3. In the Sort dialog:
- Sort by: choose the column
- Sort on: usually "Cell Values"
- Order: A to Z, Z to A, or Smallest to Largest / Largest to Smallest
Step 4. Click Add Level to sort by a second column when the first column has ties. For example: sort by Region A→Z, then by Revenue largest to smallest within each region.
⚠ WATCH OUT
If your data has blank rows in the middle, Excel will stop sorting at the first blank. Remove blank rows before sorting — or the rows below the gap won't move.
Method 2: SORT function (non-destructive, Microsoft 365)
The SORT function returns a sorted version of your data without modifying the original:
=SORT(array, [sort_index], [sort_order], [by_col])- array — your data range
- sort_index — which column to sort by (1 = first column, 2 = second, etc.)
- sort_order — 1 = ascending (default), -1 = descending
- by_col — FALSE = sort rows (default), TRUE = sort columns
Sort a table by the second column, descending:
=SORT(A2:D100, 2, -1)The result spills into adjacent cells automatically and updates whenever the source data changes.
Custom sort order
To sort by a list you define — like sorting months in calendar order rather than alphabetical:
Step 1. Go to Data → Sort → Order → Custom List.
Step 2. Select an existing list (months, weekdays) or type your own.
This is useful for sorting by status labels like "Open → In Progress → Closed" instead of alphabetically.
The Griddy way
Multi-level sorts with custom orders take more setup than most people want to do manually. Just say what you need:
"Sort this table by deal stage in the order: Prospect, Qualified, Proposal, Closed Won, Closed Lost — and within each stage, sort by deal value from largest to smallest"
Griddy applies the sort logic immediately.
Skip the manual work
Describe it. Griddy does it.
Instead of writing this formula yourself, just tell Griddy what you need in plain English. Works in Excel and Google Sheets.