Skip to main content

How to Alphabetize in Microsoft Excel

Sorting data alphabetically in Excel is something you'll probably do hundreds of times if you work with spreadsheets regularly. Client lists, product inventories, employee directories, student rosters - at some point, they all need to go in A-to-Z order. Excel has had sorting built in since the early days, but newer versions have added genuinely useful features that most people don't know about.

This guide covers five different approaches to alphabetical sorting in Excel, starting with the simplest one-click method and working up to dynamic formulas and multi-level sorts. Whether you're on Excel 365, Excel 2021, or an older version, at least three of these methods will work for you.

Quick Tip

Need to sort a list right now without opening Excel? Paste it into the tool below for instant alphabetical sorting - no software required.

Method 1: The A-Z / Z-A Sort Buttons

This is the approach most people learn first, and it handles probably 80% of sorting situations. It takes two clicks and works in every version of Excel.

  1. Click any cell in the column you want to sort by. You don't need to select the whole column - just one cell is enough for Excel to figure out the range.
  2. Go to the Data tab on the ribbon.
  3. Click the A→Z button (Sort Ascending) for alphabetical order, or the Z→A button (Sort Descending) for reverse.

Excel automatically detects your data region - it looks for the contiguous block of non-empty cells surrounding your selection and sorts all of it together. So if you have names in column A, emails in column B, and phone numbers in column C, clicking one cell in column A and hitting A→Z will rearrange all three columns so the rows stay matched up.

The one thing to watch for: if your data doesn't have headers in row 1, Excel might sort your header row into the data. You'll see "Smith, John" suddenly appear between "Singh" and "Taylor." If that happens, undo with Ctrl+Z and use Method 2 instead, where you can explicitly tell Excel about headers.

Method 2: Custom Sort (Multi-Level)

Custom Sort is what you need when a simple A-Z sort isn't enough. Maybe you want to sort by department first, then by last name within each department. Or sort by state, then by city within each state. This is where the Sort dialog box earns its keep.

  1. Click anywhere inside your data.
  2. Go to Data > Sort (or press Alt + A + S + S as a keyboard shortcut).
  3. In the Sort dialog, set your first sort level - pick the column, choose "Cell Values" for Sort On, and select "A to Z" for Order.
  4. Click "Add Level" to add a second sort criterion.
  5. Repeat for as many levels as you need, then click OK.

The "My data has headers" checkbox at the top right of the dialog is important. When checked, Excel uses your header row labels in the Column dropdown (so you see "Last Name" instead of "Column A"), and it won't sort the header into your data. Make sure it's checked if your first row contains labels.

You can also sort by cell color, font color, or cell icon if you're using conditional formatting. Pick these from the "Sort On" dropdown. It's a niche feature, but handy when you've color-coded priority levels and want to group them together.

Method 3: The SORT Function (Excel 365 and 2021+)

If you're on a recent version of Excel, the SORT function is a genuine improvement over the older methods. Instead of rearranging your source data, it outputs a sorted copy to a new location - and it updates automatically when the source data changes. Microsoft calls this a "dynamic array" function because the results spill into neighboring cells on their own.

The basic syntax:

=SORT(array, [sort_index], [sort_order], [by_col])

Here's what each part does:

  • array - The range of cells to sort (e.g., A2:A50 for one column, or A2:D50 for multiple columns)
  • sort_index - Which column to sort by, as a number. 1 means the first column of your array. This is optional and defaults to 1.
  • sort_order - 1 for ascending (A→Z), -1 for descending (Z→A). Defaults to 1.
  • by_col - TRUE to sort left-to-right across columns instead of top-to-bottom down rows. Almost always leave this as FALSE (the default).

The simplest version just needs a range:

=SORT(A2:A30)

That gives you an alphabetized copy of whatever's in A2:A30. To sort a multi-column table by the second column in descending order:

=SORT(A2:D30, 2, -1)

You can combine SORT with other functions for more targeted results. Want an alphabetized list of only unique names?

=SORT(UNIQUE(A2:A100))

Or filter first, then sort. This pulls out only the items in column A where column B says "Active," then alphabetizes them:

=SORT(FILTER(A2:A100, B2:B100="Active"))

One limitation: SORT doesn't exist in Excel 2019 or earlier. If you share a workbook with someone on an older version, they'll see a #NAME? error where your sorted results should be. Check Microsoft's sorting documentation for compatibility details across versions.

Method 4: AutoFilter Sort

AutoFilter puts dropdown arrows in your column headers, and those dropdowns include sort options. It's quick to access and works well when you're already filtering data and want to sort the visible results.

  1. Click any cell in your data range.
  2. Go to Data > Filter (or press Ctrl+Shift+L) to toggle AutoFilter on.
  3. Click the dropdown arrow in the header of the column you want to sort.
  4. Choose "Sort A to Z" or "Sort Z to A" from the top of the dropdown menu.

What makes this different from the basic A→Z buttons: if you've filtered out some rows (say, you're only showing entries from 2025), the sort applies only to the visible rows. Hidden rows stay where they are. This is useful when you want to alphabetize a subset without reorganizing your entire dataset.

AutoFilter is also nice because the dropdown stays available. You can re-sort at any time without going back to the Data tab - just click the dropdown arrow again.

Method 5: Convert to a Table

Excel Tables (the formal kind, created with Ctrl+T) come with built-in sort functionality that's always just one click away. If you're working with data you'll sort repeatedly, converting it to a Table saves time.

  1. Click any cell in your data.
  2. Press Ctrl+T (or go to Insert > Table).
  3. Confirm the range and check "My table has headers," then click OK.
  4. Your data now has dropdown arrows in every header cell - click any one and choose "Sort A to Z."

Tables have other benefits too: they automatically expand when you add new rows, formulas in calculated columns fill down automatically, and structured references make your formulas more readable. But even if you only care about sorting, the always-available dropdown arrows are a nice convenience.

Sorting Partial Selections

Sometimes you need to sort just a piece of your data - not the whole sheet. Select the specific range you want to sort before clicking the A→Z button. Excel will ask whether to expand the selection. Choose "Continue with the current selection" to sort only what you highlighted.

Be careful with this. If you sort column A independently without including columns B, C, and D, the data in those other columns stays put. Your rows will be mismatched. Only sort a partial selection if the data truly is independent - like a standalone list that isn't connected to anything else on the sheet.

Handling Common Excel Sorting Problems

A few situations trip people up when sorting alphabetically in Excel:

  • Numbers stored as text - If you see numbers left-aligned in their cells, Excel is treating them as text. Alphabetical sort puts "10" before "2" because it compares character by character. Fix this by selecting the cells, clicking the yellow warning triangle, and choosing "Convert to Number."
  • Leading spaces - Extra spaces before text cause sorting errors. Use =TRIM(A2) to clean them up, or do a Find & Replace (Ctrl+H) searching for a space at the start of cell values.
  • Merged cells - Excel can't sort ranges that contain merged cells. You'll get an error message. Unmerge the cells first (Home > Merge & Center to toggle it off), sort, then re-merge if you need to.
  • Hidden rows - If rows are hidden (not filtered, but manually hidden), sorting includes them. The hidden rows get repositioned along with everything else, which can cause confusion when you unhide them later. Unhide all rows before sorting to avoid surprises.
  • Formulas vs. values - Sorting works on the displayed value, not the underlying formula. If a cell shows "Apple" because of a VLOOKUP, it sorts under A - which is usually what you want. But if the VLOOKUP references move during the sort, your formulas might break. Use absolute references ($A$2:$D$100) in lookups that reference sorted data.

When to Use Each Method

Method Best For Keeps Original? Excel Version
A-Z / Z-A Buttons Quick one-time sort No All versions
Custom Sort Multi-column sorting No All versions
SORT Function Dynamic sorted copies Yes 365 / 2021+
AutoFilter Sorting filtered subsets No All versions
Table Sort Frequent re-sorting No 2007+

Keyboard Shortcuts for Sorting in Excel

If you sort data frequently, these shortcuts save time:

Shortcut Action
Alt + A + S + A Sort Ascending (A→Z)
Alt + A + S + D Sort Descending (Z→A)
Alt + A + S + S Open Custom Sort dialog
Ctrl + Shift + L Toggle AutoFilter on/off
Ctrl + T Convert range to Table

Frequently Asked Questions

How do I sort alphabetically in Excel?
Select any cell in the column you want to sort, go to the Data tab on the ribbon, and click the A-Z button (Sort Ascending). Excel will sort the entire data region by that column from A to Z. For reverse order, click the Z-A button instead.
Will sorting mess up my other columns?
If your data is in a contiguous table (no blank rows or columns breaking it up), Excel automatically expands the sort to include all related columns so your rows stay together. If Excel detects only one column is selected, it will ask whether to expand the selection - always choose "Expand the selection" to keep your data intact.
Can I sort by multiple columns in Excel?
Yes. Go to Data > Sort to open the Sort dialog. Click "Add Level" to add additional sort criteria. For example, sort by Last Name first (A to Z), then by First Name (A to Z) as a secondary sort. Excel applies the levels in order from top to bottom.
How do I sort without affecting other rows?
If you only want to sort one column independently (without moving data in other columns), select just that column before sorting. When Excel asks about expanding the selection, choose "Continue with the current selection." Be careful with this - it breaks the row associations between columns.
Why does my sort put blank cells in the wrong place?
Excel always puts blank cells at the bottom of a sorted range, regardless of whether you sort ascending or descending. This is by design. If blanks are causing problems, consider filling them with a placeholder value before sorting, or use a helper column to flag empty cells.
How do I sort a filtered list alphabetically?
Apply a filter first (Data > Filter), then use the dropdown arrow in the column header and select "Sort A to Z." Excel sorts only the visible (filtered) rows while leaving hidden rows in place. This is handy when you need to sort a subset of your data without disturbing the rest.