Sort an Excel Column Alphabetically Without Mixing Rows

Formulas & functions · Updated November 18, 2026

To sort a column alphabetically in Excel for Microsoft 365 on Windows, click a cell in the column and choose Home > Sort & Filter > Sort A to Z. If the column belongs to a table of related records, choose to expand the selection when Excel asks; that keeps each row’s information together.

The quickest way to sort a column A to Z

For a simple list, the built-in sort takes only a few clicks. Click any populated cell in the column you want to arrange, then select Home > Sort & Filter > Sort A to Z. You can also use the Data tab and choose Sort A to Z. Excel rearranges the entries in ascending order, from A toward Z.

For example, if a column contains Mira, Alex, and Noah, an A-to-Z sort puts Alex first, followed by Mira and Noah. To reverse the order, use Sort Z to A. The same commands work for many other kinds of data: numbers sort from smallest to largest or largest to smallest, and dates sort from oldest to newest or newest to oldest.

  1. Click one cell within the list or table column. You usually do not need to select the whole column.
  2. Open Home > Sort & Filter and choose Sort A to Z.
  3. If Excel asks whether to expand the selection, choose Expand the selection when other columns contain information belonging to the same records.
  4. Check the first and last few rows to confirm the order and verify that related details stayed on the correct rows.

On Excel for Mac, use the Data tab’s ascending sort command or the corresponding sort command on the ribbon; the exact ribbon layout can vary by window size. Excel for the web also provides ascending and descending sort commands on the Data tab. The key principle is the same across versions: sort the range or table that contains the complete records, not an isolated field.

Why expanding the selection matters

A spreadsheet row often represents one complete record. For example, a contact list might have a name in column A, an email address in column B, and a city in column C. If you sort only the names in A while leaving B and C in place, the names no longer match their email addresses and cities. This is one of the most common and consequential sorting mistakes.

When you start a sort inside a contiguous block of data, Excel generally recognizes the surrounding range and may ask whether to expand the selection. Choose Expand the selection to move entire rows together. If the prompt does not appear, or if your data has blank columns that divide it into separate blocks, select the complete range first, including every column that belongs to the records, and then sort.

Consider a list with names in A2:A6 and phone numbers in B2:B6. To alphabetize the names without breaking the pairings, sort the range A1:B6 if row 1 contains headings. Do not select only A2:A6. After sorting, each phone number should still sit on the same row as its original owner. When uncertain, save a copy or use Ctrl+Z immediately if the result is wrong; on Mac, use Command+Z. Undo may not be available after certain later actions, so checking the selection before sorting is safer.

Headers, tables, and the Sort dialog

A heading such as Name or Department should normally stay at the top, not be treated as an ordinary value. Excel often identifies a header row automatically when you sort a nearby range, and Excel tables keep their header row separate from the records. Still, inspect the result. If a heading has moved into the list, undo the sort and use the full Sort dialog to identify the header correctly.

For more control, select a cell in the data and choose Data > Sort. In the dialog, select the column to sort by under Sort by, choose Cell Values under Sort On, and select A to Z under Order. If the first row contains headings, make sure My data has headers is selected. The dialog is especially useful when there are several columns, multiple sorting rules, or a range where Excel has not recognized the boundaries correctly.

If the data is an Excel table, clicking a header’s filter arrow gives another direct option: choose Sort A to Z or Sort Z to A. Table sorting keeps each row intact and applies the order to the records in that table. To make a regular range into a table, select the data and choose Insert > Table, then confirm whether the range has headers. Tables are handy for lists that grow because their headers and filter controls remain available as you add records.

Sorting by more than one column

Alphabetizing one field may not be enough when several entries share the same value. The Sort dialog lets you set a primary sort and additional levels. For a contact list, you could sort first by City from A to Z and then by Last Name from A to Z. Excel groups records by city and alphabetizes names within each city.

To add levels, open Data > Sort, choose the first column and order, then select Add Level. Set the next column and its order. Excel applies the levels in sequence: the first rule determines the broad groups, and the next rule organizes ties within those groups. A department directory, for example, can be sorted by Department and then by Employee Name.

Sorting is not the same as filtering. Sorting changes the order of records; filtering hides records that do not meet chosen conditions. You can sort a filtered list, but only visible rows may appear while the filter is active. Clear the filter if you need to inspect the complete dataset. Also remember that a custom order, such as High, Medium, Low, is not alphabetical. For a specific nonalphabetical sequence, use the Sort dialog’s custom-list options rather than expecting A to Z to understand the intended ranking.

Use a formula when you need a separate sorted result

A normal sort changes the order of the original cells. If you want to preserve the source list and display an alphabetized copy elsewhere, Excel for Microsoft 365 includes the SORT function. With names in A2:A7, enter =SORT(A2:A7) in an empty cell outside the source list. It returns a separate ascending list and spills the results into the cells below. The source values remain in their original order.

For example, if A2:A7 contains Leo, Ana, Zoe, Ben, Mia, and Ava, the formula returns Ana, Ava, Ben, Leo, Mia, and Zoe. Leave enough empty cells below the formula for the results; otherwise Excel may show a spill error. The formula sorts the values in that range, but it does not automatically carry other columns along. To return complete rows sorted by the first column, with records in A2:B7, use =SORT(A2:B7,1,1) in an empty area. The second argument says to sort by the first column of the selected array; the final 1 requests ascending order.

These dynamic-array formulas are available in Microsoft 365 and Excel 2021 or later. If you edit the source values, the displayed result updates automatically. Use a regular sort instead when you need to rearrange the original records, or when you are working in a version without the function. Avoid placing a formula’s spill range inside an Excel table, because dynamic-array results need room in the worksheet grid.

Common sorting problems and how to fix them

If the result looks out of order, the cause is often the contents of the cells rather than the sort command. Leading or trailing spaces can affect where text appears. Inconsistent spelling, punctuation, and extra spaces can also make entries that look similar sort differently. For example, a name preceded by a space may appear before names beginning with A. Clean the source values before sorting if consistent text order matters.

  • The heading moved: Undo, reopen Data > Sort, and confirm My data has headers. Include the heading row in the selected range.
  • Details no longer match: Undo immediately and repeat the sort with the entire record range selected, or choose Expand the selection.
  • Some records were missed: Check for blank rows or columns splitting the data. Select the full intended range explicitly before sorting.
  • Numbers seem oddly ordered: Some values may be stored as text while others are numeric. Convert them to a consistent data type, then sort again.
  • Blank entries appear unexpectedly: Blank cells may be included in the sort range. Decide whether to remove, fill, or retain them, and select the range accordingly.
  • Excel will not sort: Merged cells within the sort range can prevent sorting, and worksheet protection may restrict changes. Unmerge cells or adjust protection as appropriate.

Excel’s ordinary text sort is not a substitute for proofreading or standardizing data. Similar-looking labels such as St. John, Saint John, and St John are different text values. Likewise, alphabetical order does not establish that two records are duplicates. If you need a reliable directory, standardize names first and make sure the selected range includes all relevant fields.

Choosing between a direct sort, a table, and a formula

Choose the method based on what you want to happen to the original data. A direct A-to-Z sort is quickest when you want to reorder a complete list once. A table is convenient for a maintained dataset because its column headers provide sorting controls and its structure helps keep records together. A SORT formula is useful when the original order must remain untouched while a live sorted view appears elsewhere.

For a one-time cleanup of a customer list, select the full range and sort by the customer-name column. For a list used repeatedly, make it a table and sort through the relevant header. For a report that needs to show both the original entry order and an alphabetized version, keep the source intact and use a formula in a separate area. Each approach is valid; the important distinction is whether the operation should rearrange the source or create a separate result.

Before sorting a workbook you did not create, look for formulas, notes, totals, and data stored in nearby columns. A range that appears to be a single list may contain extra fields that are essential to its records. If the data is important, save a separate copy before making a large change. Sorting is easy to perform, but a carefully chosen range is what makes the result dependable.

Frequently Asked Questions

How do I sort one Excel column alphabetically?
Click a cell in the list and choose Home > Sort & Filter > Sort A to Z. If other columns contain information for the same records, expand the selection so entire rows move together.

How do I sort alphabetically without mixing up rows?
Select the complete data range or choose Expand the selection when Excel prompts you. Sorting only the name column can separate names from the other information on their original rows.

How do I keep the header at the top when sorting?
Use the Sort dialog at Data > Sort and make sure My data has headers is selected. Excel tables also keep their header row separate when you sort from a column’s filter arrow.

Can Excel sort a column automatically when I add new entries?
A regular sort does not continually rearrange new entries as you type. In Microsoft 365 or Excel 2021 and later, a formula such as =SORT(A2:A20) can show an automatically updated sorted result, provided the source range and spill area are set up appropriately.

Can I sort by last name if the cells contain full names?
A standard A-to-Z sort compares the cell contents from the beginning, so it sorts full names by the first characters in each cell. To sort by last name, put last names in a separate column or extract them into a helper column, then sort the complete records by that field.

Why is my alphabetized list not in the order I expected?
Check for leading spaces, inconsistent text and number formats, blank rows, or a range that leaves out some entries. Also confirm that you chose A to Z rather than a custom order or a different sort column.

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.