Skip to content
Blog/Excel
Excel

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.

Do this with AI

Try Griddy free

Start in your browser. Also works with Excel and Google Sheets.

By Justin Freels//4 min read

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:

fx
=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:

fx
=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.

Sort safely without changing the source

Before using an in-place sort, select the complete table or convert the range to an Excel Table. Sorting one column alone can separate names, amounts, and dates that belong to the same record. Include headers in the selection and confirm Excel recognized them as headers in the Sort dialog.

Use a helper column when the business order is not alphabetical—for example, map Prospect, Qualified, Proposal, and Closed Won to numeric ranks. For a reusable view, use the SORT function on a copy and leave the source rows intact. Whichever method you choose, spot-check the first and last records, then save or undo only after confirming that row relationships and formulas still line up.

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.

Sources

Do this with AI

Turn the instructions into a finished spreadsheet.

Tell Griddy what you need in plain English, then inspect and keep editing the result in the browser, Excel, or Google Sheets.

Try Griddy freeStart in your browser. No download required.
Also works withExcel Google Sheets

Use this on real templates

Sort the templates you review every week

Sorting is a daily workflow in campaign calendars, publishing boards, and outreach lists where teams constantly reorder work by date, owner, or priority.

Marketing