Excel does not have a true "auto sort" switch that reorders rows the instant a cell changes, but you can get the same result with a Table, a formula-based sort, or a one-click re-sort. The quickest reliable method is to convert your range to an Excel Table (Ctrl+T), then use the sort arrows in the header row; the table remembers the sort and re-applies it when you refresh or re-sort. For a fully automatic order that updates as values change, use the SORT and SORTBY dynamic array functions in Microsoft 365 or Excel 2021 and later. This guide covers both, plus the mistakes that break sorting and how to fix them.
What You'll Need
- Excel 2016 or later for the manual and Table methods; Microsoft 365 or Excel 2021+ for the SORT and SORTBY functions.
- A worksheet where each column has a single header in row 1 and no blank rows or columns inside the data.
- Consistent data types in each column (all dates as dates, all numbers as numbers) so Excel sorts them correctly.
Step-by-Step
- Clean the layout first. Put one header per column in row 1, remove merged cells, and delete blank rows or columns inside the range. Sorting fails or scrambles data when Excel sees gaps or merged cells.
- Select the whole data range. Click any cell in the data and press Ctrl+A, or drag from the top-left header to the bottom-right value. Include the header row.
- Convert to a Table. Press Ctrl+T (or go to Insert > Table) and confirm "My table has headers." A Table keeps rows together when you sort and expands automatically as you add rows.
- Sort with the header arrows. Click the drop-down arrow on the column you want to sort by, then choose Sort A to Z, Sort Z to A, or Sort Smallest to Largest. The whole row moves with the sorted value, so records stay intact.
- For multi-level sorting, open the dialog. Go to Data > Sort. Set Sort by to your first column, click Add Level, then set Then by to the next column. Tick "My data has headers" so the header stays on top.
- Re-apply after edits. A Table does not re-sort itself when you type a new value. Click the header arrow and choose the sort again, or use Data > Sort; the Table keeps the same range and headers, so it is one click.
- For a live auto-sort, use a formula. In an empty area, enter
=SORT(A2:D100, 1, 1)to sort the range by the first column ascending. Change the second argument to the column number and the third to -1 for descending. The result spills into neighbouring cells and updates automatically when the source data changes. - Sort by a different column with SORTBY. Use
=SORTBY(A2:D100, C2:C100, 1)to sort the rows by column C while keeping all four columns. This is the closest thing to true auto sorting in Excel. - Keep the formula output clear. Leave enough empty cells to the right and below for the spill range; if any cell in the way contains data, you get a #SPILL! error. Delete the blocking content or move the formula.
- Save and test. Change a value in the source range and confirm the SORT output reorders. If you used a Table, confirm the header arrows still work after saving and reopening.
Common Mistakes
- Sorting a single column. Selecting only column B and clicking Sort reorders that column alone and breaks the row relationships. Always select the full range or use a Table.
- Leaving blank rows. Excel treats a blank row as the end of the data, so rows below it are left unsorted. Remove blanks first.
- Mixing text and numbers. Numbers stored as text sort as text (1, 10, 2), and dates stored as text sort alphabetically. Convert them with Text to Columns or VALUE before sorting.
- Merged cells in the sort range. Merged cells block sorting and can throw an error. Unmerge them and repeat the header in each row if needed.
- Forgetting the header tick. In Data > Sort, if "My data has headers" is unticked, the header row gets sorted into the data. Tick it.
- Expecting a Table to re-sort on edit. It does not; you must re-apply the sort. Only the SORT and SORTBY functions update automatically.
- Overwriting the spill range. Typing in a cell that the SORT formula needs returns #SPILL!. Keep the output area empty.
Tips
- Use a Table even if you sort manually; it keeps formatting, formulas and row integrity together.
- Name your source range (Formulas > Define Name) so SORT formulas read clearly, e.g.
=SORT(Orders, 2, -1). - Sort by date columns formatted as real dates, not text, so chronological order works.
- To sort by a custom list (Months, weekdays), use Data > Sort > Order > Custom List.
- For a dashboard, put the SORT formula on a separate sheet and leave the raw data sheet untouched.
- Copy the SORT output and Paste Special > Values if you need a static sorted snapshot.
Troubleshooting
- Sort arrows missing: the range is not a Table. Select it and press Ctrl+T.
- "This operation requires the merged cells to be identically sized": unmerge cells in the range, then sort again.
- Rows out of order after sorting: you likely sorted a single column. Undo with Ctrl+Z, select the full range, and re-sort.
- #SPILL! error: the formula output is blocked. Clear cells to the right and below, or move the formula.
- #NAME? error: SORT or SORTBY is not available in your Excel version. Use the Table method instead, or update to Microsoft 365.
- Numbers sort as 1, 10, 2: they are stored as text. Select the column, use Data > Text to Columns > Finish, or multiply by 1 in a helper column.
- Sort does nothing: check for leading spaces or apostrophes in cells; these make values text. Use TRIM and remove apostrophes.
Frequently Asked Questions
Does Excel have a true auto-sort feature?
No. Excel does not re-sort rows automatically when a value changes. Use a Table and re-apply the sort, or use the SORT and SORTBY functions for output that updates automatically.
Why does sorting scramble my data?
You selected only one column instead of the full range. Excel sorts the selected cells only, so adjacent values no longer match their rows. Undo and sort the whole range or a Table.
Can I sort by more than one column?
Yes. Go to Data > Sort, set Sort by, click Add Level, and set Then by. Tick "My data has headers" so the header stays in place.
Do SORT and SORTBY work in Excel 2019?
No. They are dynamic array functions available in Microsoft 365 and Excel 2021 and later. In older versions, use a Table and the sort arrows.
How do I keep the header row from sorting?
In Data > Sort, tick "My data has headers." If you use a Table, the header is recognised automatically.
Can I sort by month or weekday names?
Yes. In Data > Sort, open Order and choose Custom List, then pick the built-in Months or Weekdays list.