Sort an Entire Excel Spreadsheet by One Column

Formulas & functions · Updated November 18, 2026

To sort an entire Excel spreadsheet by one column, click a cell in your data, choose Data > Sort, select the column and sort order, and confirm that the full data range is included. If Excel asks whether to expand the selection, choose Expand the selection so each row stays together.

What “sort the entire spreadsheet” means

Usually, this request means rearranging complete records according to one field—for example, sorting a customer list by last name while keeping each person’s phone number, email address, and other details on the same row. The sort key is one column; the rows across the data range move with it.

It usually does not mean sorting one column independently. If you sort only the cells in a names column while leaving the adjacent phone-number column untouched, the names and phone numbers can become mismatched. Nor does it usually help to sort every empty cell in the worksheet. The practical goal is to sort the complete rectangular block containing the related records.

Excel treats a worksheet as a grid with over a million rows, but a data list is generally only a small part of that grid. Sorting the data range is safer and clearer than selecting every cell on the sheet, especially if the worksheet contains notes, separate tables, or calculations elsewhere.

Sort a range on Excel for Microsoft 365 on Windows

For a typical list with one header row and uninterrupted data, use the Sort dialog to specify the key and confirm that the range is correct:

  1. Save your workbook or make sure you can undo the change if the result is not what you expect.
  2. Click any cell inside the data block. Avoid clicking a cell in a separate note or another table.
  3. On the ribbon, select Data > Sort.
  4. In the Sort dialog, check My data has headers if the first row contains labels such as Name, Region, or Date.
  5. Under Column, choose the column to sort by. Under Sort On, leave Cell Values for an ordinary sort.
  6. Under Order, choose an appropriate order, such as A to Z, Z to A, Smallest to Largest, Largest to Smallest, or Oldest to Newest.
  7. Select OK. Check a few complete records afterward to confirm that their fields stayed together.

If you use the quick sort buttons on the Data tab instead, Excel may display a prompt asking whether to expand the selection. Choose Expand the selection, then confirm the sort. That tells Excel to move adjacent columns along with the chosen column. Choosing Continue with the current selection sorts only the selected cells and can detach values from their records.

For a formatted Excel table, click a cell in the table and use the filter arrow in the desired column header to choose a sort order. Excel sorts the table’s rows and keeps the header in place. You can also use the Data tab’s sort controls.

Include every related column and row

The most important decision is the sort range. A normal list should have one record per row and one kind of field per column. For example, a sales list might have Order ID, Date, Customer, and Amount columns. Sorting by Date should move the Order ID, Customer, and Amount values with each date.

When you start with a cell inside a contiguous block, Excel commonly detects the surrounding data region. If you instead select a single column or a narrow portion of the list, Excel may ask whether to expand the selection. Expand it when the adjacent columns belong to the same records. If there is no prompt, stop and inspect the selection before sorting if you are unsure it includes all the related fields.

Blank rows and blank columns can divide a worksheet into separate regions. Excel may interpret such a gap as the end of one data block, so a quick sort might leave records below the gap untouched. If the list contains intentional blank lines, select the full rectangular range explicitly before opening Data > Sort. Do not include unrelated tables just because they happen to be nearby.

  • Include the header row when sorting a range, then enable My data has headers so Excel treats it as labels rather than a record.
  • Include every column that belongs to the records, even if some columns are hidden.
  • Exclude separate summaries, instructions, or other data blocks that should not move with the list.

Choose the right sort order and data type

For text, A to Z arranges values alphabetically, while Z to A reverses that order. For numbers, Smallest to Largest and Largest to Smallest are usually the clearest choices. For dates stored as actual Excel dates, Oldest to Newest and Newest to Oldest arrange them chronologically.

Displayed values can be misleading if a column mixes data types. For example, some entries that look like dates may actually be text, or numbers may be stored as text. Excel can then sort some values differently from what you expect. If 2, 10, and 100 are text strings, for instance, their order may follow character-by-character text rules rather than numeric size. Convert inconsistent entries to a consistent type before relying on the result.

In the Sort dialog, Sort On can also sort by cell color, font color, or a conditional-formatting icon when those options apply. For ordinary data, choose Cell Values. A custom list is useful when a natural sequence is not alphabetical—for example, sorting weekdays from Monday to Sunday or priority labels in a chosen order. Excel’s custom-list behavior depends on the list being recognized or configured in Excel’s options.

Sort an Excel table, filtered list, or worksheet

Excel tables are a convenient choice for ongoing lists. When you convert a range to a table using Home > Format as Table, Excel provides header filter buttons and extends table behavior as data is added. Sorting from a table header sorts the table records without treating the header as ordinary data. It also helps make the intended boundary of the list visible.

A filtered list can still be sorted using its header controls or the Data tab. Filtering hides records that do not meet the filter; sorting changes the order of records in the list. After sorting, a filter may still hide some rows, so clear or review the filter if you think records are missing. Do not assume that a filtered view means the underlying records have been deleted.

If by “entire spreadsheet” you mean all populated cells on a worksheet, first decide whether those cells form one coherent dataset. A sheet containing two independent lists should not be sorted as one large range: rows from the first list could be mixed with rows from the second. Sort each dataset separately, or reorganize related records into one table before sorting. A worksheet-wide selection is rarely the right boundary for a simple list sort.

Sort on Mac and in Excel for the web

In Excel for Mac, the main approach is similar: click in the data, open Data > Sort, choose the column and order, and confirm the header setting. Ribbon wording or layout can vary slightly by release, but the Sort command and its purpose are the same. On Mac, Command+Z undoes a sort; on Windows, use Ctrl+Z.

In Excel for the web, select a cell in the data and use the Data tab’s sort controls, or use a table header’s sort and filter menu. If the selection-expansion prompt appears, expand the selection to keep complete rows together. Because the web interface can change, check that the displayed range and header treatment are appropriate before confirming. If a workbook is shared, sorting changes the order in the workbook; it is not merely a private visual arrangement for one reader.

Common problems and how to avoid them

The most damaging sorting mistake is sorting one column by itself. If names move but the other fields do not, undo immediately with Ctrl+Z on Windows or Command+Z on Mac, then repeat the sort on the full data range. If you have made later changes since the sort, undo may also reverse those changes, so make a copy before sorting data that is difficult to reconstruct.

  • The header moved into the records: Open the Sort dialog and enable My data has headers, then sort again.
  • Some rows did not move: Look for blank rows or columns that split the data, or check whether the selected range stopped early.
  • The order looks strange: Check for numbers or dates stored as text, extra spaces, inconsistent spellings, or mixed data types.
  • Related cells moved unexpectedly: Confirm that the full record range was included and that an unrelated block was not included by mistake.
  • Excel will not sort the range: Merged cells within a sort range can interfere with sorting. Unmerge them where appropriate and give each field a consistent row-and-column layout.

Before a high-impact sort, consider making a duplicate worksheet or saving a copy of the file. Sorting is reversible with Undo immediately afterward, but a separate copy is a more dependable safeguard when you may continue editing before noticing a problem.

When one sort column is not enough

Sorting by one column groups and orders records using one key. If several rows have the same value in that column, their relative order may not provide the secondary arrangement you want. For example, sorting a staff list by Department puts departments together, but it does not necessarily alphabetize employees within each department.

Use a multi-level sort when you need a tie-breaker. In Data > Sort, set the first level to Department, then select Add Level and set the next level to Employee Name. Excel sorts by the primary key first and applies the next key within matching primary values. You can add further levels, such as Department, then Location, then Name, when the data calls for them.

For repeatable reporting, consider turning the range into a table and keeping clear, consistent headers. If you only need a separate sorted view rather than changing the source order, a dynamic-array formula such as SORT can be an alternative in Microsoft 365 or Excel 2021 and later; it returns a sorted result in another area when the range permits. That is different from sorting the original records in place, and it requires care if the source data changes or the output area is occupied.

Frequently Asked Questions

How do I sort an entire Excel sheet by one column without mixing up rows?
Click inside the data and choose Data > Sort, or choose a quick sort and select Expand the selection when prompted. Make sure the full set of related columns is included.

Should I select the whole worksheet before sorting?
Usually not. Sort the rectangular range that contains the records. Selecting the entire worksheet can include unrelated data and is unnecessary for an ordinary list.

How do I keep the header row at the top?
In the Sort dialog, check My data has headers. When sorting an Excel table using its header menu, the header is treated as a label automatically.

Can I sort an Excel spreadsheet alphabetically by last name?
Yes, if last names are in their own column, sort that column A to Z while including all related columns. If full names share one column, sorting may use the first characters of the full name; split or otherwise organize the names if you specifically need a last-name sort.

Can I undo a sort in Excel?
Use Ctrl+Z on Windows or Command+Z on Mac immediately after sorting. If you have made other changes since then, save a copy before attempting a complex recovery.

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.