Sort Excel Alphabetically: Rows, Columns, and Lists

Formulas & functions · Updated November 2, 2026

Sort Excel Alphabetically: Rows, Columns, and Lists

To sort a list alphabetically in Excel for Microsoft 365 on Windows, select a cell in the column, then choose Data > Sort A to Z. If the list is part of a larger table, Excel can sort the entire set of rows together; check the selection prompt and choose Expand the selection so each person’s or item’s details stay on the correct row.

What alphabetical sorting does

An alphabetical sort rearranges text according to character order. Ascending order runs from A to Z, while descending order runs from Z to A. Excel uses the same Sort commands for other data types: numbers can be arranged from smallest to largest or largest to smallest, and dates from oldest to newest or newest to oldest.

Sorting is different from filtering. A sort changes the order in which rows appear, but it does not remove records. A filter temporarily hides records that do not meet a condition. You can use both together—for example, filter a customer list to one region and then sort the visible customers by name.

Excel sorts whole rows when it recognizes neighboring data as a range or table. That matters because a name, address, and account number in one row belong together. Sorting only the name cells can separate names from their associated details, producing a list that looks orderly but contains incorrect records.

Sort a single column without scrambling data

For a simple list with related information in adjacent columns, use these steps:

  1. Click a cell in the column you want to sort, rather than selecting just the cells containing its text.
  2. Open the Data tab and choose Sort A to Z for ascending order, or Sort Z to A for descending order.
  3. If Excel asks whether to expand the selection, choose Expand the selection, then click Sort.
  4. Check a few rows afterward to confirm that all values across each row moved together.

The same commands are available from Home > Sort & Filter. On Windows, the ribbon keytip sequence Alt+A, S, A starts an ascending sort from the Data tab in many current Excel configurations; keytips can vary, so the visible ribbon command is the dependable option. On Mac, use the Data tab and choose the sort command; Windows Alt keytips do not apply in the same way.

If Excel does not offer to expand the selection, or if the data is separated by completely blank rows or columns, pause before sorting. Select the full rectangular range of related data first, including its headers if present, and then open the Sort dialog. A carefully selected range is safer than sorting one column alone.

Sort a table or range with headers

Excel tables are a useful choice for lists that grow over time. To make one, select the data and choose Insert > Table, making sure My table has headers is selected when the first row contains labels. Each header then has a filter arrow. Open the arrow for the column you want and choose Sort A to Z or Sort Z to A. Excel reorders the table’s records while keeping each row intact.

For a regular range, or when you want more control, select a cell in the data and choose Data > Sort. In the Sort dialog, verify the range, indicate whether the data has a header row, select the column under Sort by, and select A to Z under Order. The header setting prevents a label such as Name from being treated as an ordinary record and moved into the list.

Before sorting, remove accidental blank rows or make sure the range includes all records. A blank line in the middle can make Excel interpret one list as separate blocks. Also check that there are no merged cells in the range: merged cells can prevent sorting or make the intended records unclear.

Sort by multiple columns

A single alphabetical sort may leave many items tied—for example, several employees may share the same department. A multi-level sort provides a predictable order within those groups. Choose Data > Sort, set the first column and order, then click Add Level to add a second criterion. Excel applies the first level, then sorts matching values according to the next level.

For example, to group employees by department and arrange each group by surname, set Department as the first level and Surname as the second. If there are duplicate surnames, add a third level such as First Name. The order of the levels matters: putting Surname first would group the entire list by surname instead of department.

Use multiple levels whenever the primary field has repeated values and a stable secondary order is useful. In the Sort dialog, you can also remove a level, change the level order, or choose a different column without rebuilding the list. For a table, its filter arrows can sort one field quickly, but the Sort dialog is clearer when several criteria are required.

Sort left to right or use a custom order

Most worksheets are sorted top to bottom, with each record occupying a row. If your categories run across columns instead, open Data > Sort, choose Options, select Sort left to right, and confirm. Then choose the row whose values should control the order. This changes the direction of sorting; it is not the usual choice for a list of records.

Alphabetical order is not always the order people expect. A list of priority labels may need High, Medium, Low rather than alphabetic order. In the Sort dialog, use the Order menu and select a built-in or custom list when an available custom order suits the data. You can also create a custom list through Excel’s options, then use it for repeated sorting. Custom ordering is useful for weekdays, months, or organization-specific stages.

Another common surprise is numerical text. If entries are stored as text, a text sort may put Item 10 before Item 2 because it compares characters rather than interpreting the ending as a number. If the number is in its own numeric column, sort by that column. Otherwise, consider separating the text label and number into different columns or converting the numeric text to actual numbers before sorting.

Sort names, blanks, and mixed text

Excel sorts a full name by the first character in the cell. Thus, a column containing Jordan Lee and Casey Morgan sorts by first name, not surname. To sort by last name reliably, store surnames in a separate column and sort by that field. Splitting names can require judgment when people have middle names, compound surnames, or different naming conventions; a simple space-based split does not always identify the surname correctly.

Leading or trailing spaces can make entries appear out of order, and nonprinting characters copied from websites can also affect sorting. If two entries look identical but sort differently, inspect the source values and clean the data before sorting. Excel’s TRIM function can remove ordinary extra spaces from text, but it does not remove every kind of nonprinting character. Keep the original column until you have checked the cleaned results.

Blank cells and mixed data types can make a sorted list harder to interpret. Decide whether blank records are valid before sorting, and check whether numbers and dates are stored consistently as actual numeric/date values rather than as text. Excel’s sort rules also depend on the selected data and its values, so a quick review after sorting is worthwhile when a column mixes names, numbers, and empty cells.

Use a formula to show a sorted copy

If you want to keep the original list in place and display a sorted version elsewhere, Excel for Microsoft 365 and Excel 2021 or later include the dynamic-array SORT function. With names in A2:A6 in the order Zoe, Ana, Liam, Bea, Omar, enter this formula in an empty cell outside the source range:

=SORT(A2:A6)

The result spills into five cells in ascending alphabetical order: Ana, Bea, Liam, Omar, Zoe. It sorts a displayed copy rather than rearranging the source cells, and the result updates when the source values change. Leave the cells below the formula clear so the spill range has room; otherwise Excel can show a spill error.

For a multi-column range, SORT can order the rows by a chosen column. For example, with names in A2:A6 and sales figures in B2:B6, =SORT(A2:B6,2,1) returns the rows in ascending order of sales, because 2 identifies the second column of the selected range and 1 means ascending. The formula result is a separate view, not a replacement for sorting the original data. SORT is not available in older perpetual Excel versions such as Excel 2019.

Common sorting problems and safe fixes

  • Only one column moved: Undo immediately with Ctrl+Z on Windows or Command+Z on Mac, then sort again with the full range selected or choose Expand the selection. If you have made further edits, check the data carefully before trying to reconstruct the original rows.
  • The header was sorted into the records: Open Data > Sort and select My data has headers, or select the range without its header row and sort the data only.
  • The order looks wrong: Check for leading spaces, inconsistent data types, and text that contains embedded numbers. Confirm that you chose the intended column and ascending or descending order.
  • New records are not included later: Convert the range to an Excel table or update the range used in the Sort dialog. A table generally expands as you add adjacent records.
  • A sort is unavailable: Check for merged cells, protected-sheet restrictions, or a selection that includes incompatible ranges.

Sorting changes cell positions and is not generally reversible with a formula unless you have another saved copy or an original order field. If the initial order matters, add an index column before sorting, with values such as 1, 2, 3, and so on. You can later sort by that index to restore the sequence. Save a copy before major reorganization, especially in a shared or important workbook.

Frequently Asked Questions

How do I sort one column alphabetically without affecting other columns?
When the other columns contain details for the same records, do not sort the column alone. Select a cell in it, choose the ascending or descending sort command, and expand the selection when prompted. Sort only the one column when its values are genuinely independent.

Can Excel sort names by last name?
Not automatically when each full name is stored in one cell. Excel sorts the cell text from its beginning, so it sorts full names by first name. Use a separate surname column and sort by that column; splitting names may require manual review for compound or unusual names.

How do I sort alphabetically in reverse?
Select a cell in the relevant column and choose Data > Sort Z to A. In the Sort dialog, set the order to descending. The command applies to the selected field while keeping complete rows together when the range is selected correctly.

Why does Item 10 appear before Item 2?
The entries may be text, so Excel compares characters rather than treating the final digits as numbers. Store the numbers as numeric values in a separate column and sort on that column, or convert the text numbers consistently before sorting.

Can I keep the original list and sort a copy?
Yes. In Microsoft 365 or Excel 2021 and later, use the SORT function in an empty area to create a dynamically sorted result. The formula does not rearrange the source list, but it needs enough empty cells for its results to spill.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Formulas & functions

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.