Sort a List in Excel: Steps and Custom Sorts

Formulas & functions · Updated November 20, 2026

To sort a list in Excel, click a cell in the list, then choose Data > Sort A to Z or Data > Sort Z to A. For more control, choose Data > Sort and set the column, direction, and any additional sorting levels. If you mean insert a separate, automatically sorted copy rather than rearrange the original list, use Excel’s SORT function in Microsoft 365 or Excel 2021.

Sort a basic list alphabetically or numerically

In Excel for Microsoft 365 on Windows, start by clicking a cell in the column you want to sort. You normally do not need to select every cell first: Excel recognizes the surrounding data and sorts the associated rows along with the selected column. On the Data tab, choose Sort A to Z for ascending order or Sort Z to A for descending order. The labels reflect the data type: text is alphabetized, numbers go from smallest to largest or largest to smallest, and dates go from earliest to latest or the reverse.

For example, if a worksheet has customer names in column A, cities in column B, and order totals in column C, sorting by the customer-name column should move each customer’s city and total with that name. Sorting the total column in ascending order places the smallest order first. Excel does not treat every value that looks like a number as a number, however; values stored as text can sort differently, a problem covered below.

On Excel for Mac, the sorting commands are also on the Data tab, though ribbon layout can vary by window size and version. In Excel for the web, use the Data tab’s sort commands as well. If the quick buttons do not show the result you want, use the Sort dialog rather than repeatedly trying different selections.

Keep complete rows together

A sort should generally rearrange complete records, not just one column. If you sort customer names but leave the order totals in their old positions, the worksheet becomes inaccurate because names no longer match their original details. Excel often detects adjacent data and asks whether to Expand the selection when you sort a selected column. Choose that option to include the related columns. Choose Continue with the current selection only when the selected cells are intentionally independent of the surrounding data.

Before sorting, check that the list has one clear header row and no completely blank row or column splitting the data. A blank line can make Excel treat the entries above and below it as separate regions. Avoid merged cells inside the range because they can prevent sorting or make the range behave unexpectedly. If a sort prompt appears, expanding the selection is the safe choice for an ordinary table of related records.

If the list is important, keep an original copy or use Ctrl+Z on Windows immediately after a mistaken sort; on Mac, use Command+Z. Undo is useful for an accidental operation, but it is not a substitute for a backup if many later edits have been made.

Use the Sort dialog for precise control

The Sort dialog is useful when the list has headers, when you need to choose a particular column, or when a sort needs more than one rule. Click a cell in the data, open Data > Sort, and review the options. If the first row contains labels such as Customer, City, and Total, make sure My data has headers is selected so Excel treats those labels as headings rather than ordinary records.

  1. Under Sort by, choose the column name you want to use.
  2. Under Sort On, leave Cell Values selected for a normal text, number, or date sort.
  3. Under Order, select the appropriate ascending or descending option.
  4. Choose OK to apply the sort to the selected data range.

Excel also offers sorting by cell color, font color, or conditional-formatting icon when those features are present. These options can help bring highlighted records to the top, but they sort according to the selected visual property rather than the underlying numerical or alphabetical order. Check the preview choices in the dialog before applying an unfamiliar sort.

Sort by more than one column

Multi-level sorting lets you organize records by a primary value and then break ties using another value. In the Sort dialog, set the first rule, then click Add Level. For example, to group employees by department and then alphabetize names within each department, set the first level to Department in ascending order and the next level to Name in ascending order. Excel applies the second rule among rows that have the same department.

A sales report might instead sort first by Region and then by Sales from largest to smallest. The region groups stay together, while the highest sales appear first inside each group. The order of levels matters: the top rule is the main grouping rule, and lower rules refine records that tie on earlier rules. Use the up and down controls in the dialog to change a level’s priority if the results are organized in the wrong way.

For a custom hierarchy, such as High, Medium, Low, or a sequence of business stages, ordinary A-to-Z sorting may not match the intended order. Use a custom list, or add a helper column containing a numeric rank and sort by that rank. A helper column is especially practical when the desired order changes from project to project.

Sort an Excel table and keep it manageable

For a list you will maintain over time, convert the range to an Excel table with Insert > Table, confirm the range, and indicate whether it has headers. Tables make it easier to work with structured data: each column has a filter and sort control in its header, and rows added directly below a table are generally included as it expands. Use a table when records share the same set of fields, such as date, product, quantity, and price.

Click the arrow in a table’s column heading and choose an ascending or descending sort. The table still sorts complete records, and the menu also lets you filter the visible rows. A sort changes the order of the records; a filter hides records that do not meet the selected condition. For instance, filtering a Status column to show Open items does not delete closed items. Clearing the filter brings them back, while sorting changes the order in which records appear.

A table is not mandatory for sorting. A plain rectangular range can be sorted from the Data tab, and that may be preferable for a small one-time list. The main benefit of a table is ongoing organization and easier filtering, not a different sorting algorithm.

Create a separate sorted copy with SORT

If you want to preserve the source order and display a sorted result elsewhere, a dynamic-array formula can be more suitable than sorting the source in place. The SORT function is available in Microsoft 365 and Excel 2021. It returns a sorted copy of a range and can update when the source values change. The result needs clear cells below and to the right so the returned rows can spill into the worksheet.

Suppose A2:C5 contains four records with names in column A, cities in column B, and sales in column C: Alex, Toronto, 500; Bea, Ottawa, 900; Chen, Calgary, 300; and Dev, Halifax, 700. With the source records in A2:C5 and sales in the third column of that range, enter this formula in an empty cell such as E2: =SORT(A2:C5,3,-1). It sorts the records by the third column in descending order, returning Bea, Dev, Alex, and Chen, with sales of 900, 700, 500, and 300 respectively. The other fields stay with each record.

The formula’s second argument is the sort index within the supplied range, and its third argument uses 1 for ascending order or -1 for descending order. Because the result is a formula output, do not type into cells occupied by its spill range. If Excel shows a spill error, clear any blocking content or merged cells in the area where the results need to appear. In older Excel versions that do not support SORT, use the Sort dialog to rearrange a copy of the data instead.

Fix common sorting problems

If text appears in an unexpected order, inspect the cells for leading spaces, inconsistent spelling, or numbers stored as text. A column containing numeric values mixed with text can sort in groups rather than as one clean numerical sequence. Use Excel’s warning indicators or number-format and data-cleaning tools to convert values consistently before sorting. Changing a cell’s display format alone may not convert text into a real number.

If dates appear out of order, some entries may be stored as text or may use inconsistent date formats. Check whether the cells behave as dates when formatted or edited, and correct the underlying values if needed. Also check for hidden rows or filters: a sort may apply to the full range even though only some records are currently visible, depending on how the data is arranged and selected.

  • Only one column moved: undo immediately, then repeat the sort and choose to expand the selection.
  • The header was sorted among the records: reopen the Sort dialog and select My data has headers.
  • Rows seem missing: clear active filters or inspect hidden rows before concluding that data was deleted.
  • New entries are not included: check whether they were added inside the table or within the original sorted range.

When a sort produces an unexpected result, undo it and check the selected range before trying again. Sorting an incomplete range can separate related records even when the sort direction itself is correct.

Frequently Asked Questions

How do I sort a list alphabetically in Excel?
Click a cell in the list or its text column, then choose Data > Sort A to Z. If the list has related columns, expand the selection when Excel asks so each row stays together.

How do I sort by last name when names are in one column?
Excel sorts the text in a cell as a whole; it does not automatically identify the last-name portion. Add a separate Last Name column, fill it with the extracted or entered surnames, and sort the complete range by that column.

Can I sort a list without changing the original order?
Yes. In Microsoft 365 or Excel 2021, put a SORT formula in an empty area and point it at the source range. It returns a sorted copy while leaving the original cells in place.

Why does Excel sort 1, 10, and 2 in the wrong order?
The values may be stored as text, in which case Excel can sort them alphabetically rather than numerically. Convert the entries to real numbers, then sort again. A consistent numeric column should sort as 1, 2, 10 in ascending order.

How do I sort by month name in calendar order?
Use the Sort dialog and select a built-in month custom list if it is offered in the Order choices. If the required order is specific to your workbook, create a helper column with month numbers and sort by that column instead.

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.