Excel Sort Warning: Expand the Selection vs Current Selection
By ExcelReady TeamUpdated 7 min read
The short answer
Choose "Expand the selection" almost every time. It sorts every column in the block, so each row's values stay together. "Continue with the current selection" sorts only the cells you selected, so names, salaries or dates in the other columns stop matching their rows. Use it only when the selected column is an independent list. If you picked it by mistake, press Undo straight away.
Key takeaways
- The Sort Warning appears when you select part of a block of data and sort; it means Excel found data next to your selection.
- Expand the selection (the default) moves whole rows; Continue with the current selection moves only the selected cells.
- A one-column sort doesn't change totals, so a SUM check won't catch it; an ID lookup or a backup copy will.
- Undo (Ctrl+Z, Mac: ⌘Z) reverses either choice if you catch it straight away.
- Avoid the dialog: click one cell before sorting, or turn the data into a table with Ctrl+T (Mac: ⌘T).
On this page+
- Expand the selection vs current selection at a glance
- Why Excel shows the Sort Warning
- The same staff list, sorted both ways
- When to use Expand the selection
- When to use Continue with the current selection
- How to decide: a quick checklist
- How to avoid the warning, and how to spot a scrambled sort
- What a job test usually checks
- Our recommendation
- Practise it
When the Excel sort warning asks you to choose, pick Expand the selection. It sorts the whole block of data, so every row keeps its own values. Continue with the current selection sorts only the cells you selected, which quietly separates names from their salaries, departments or dates. This comparison is for anyone who has seen the Sort Warning and wasn't sure which button to trust, and for anyone sorting data in an Excel test.
Expand the selection vs current selection at a glance#
The two options differ in one thing: whether the neighbouring columns move with the column you sort.
| Feature | Expand the selection | Continue with the current selection |
|---|---|---|
| What gets sorted | The whole block of data around your selection | Only the cells you selected |
| Rows stay together | Yes | No |
| Default option in the dialog | Yes | No |
| Risk | Low; it may miss columns past a blank column | High; records no longer match |
| Excel warns you afterwards | Not needed | No, the damage is silent |
| Right for | Almost every sort of a table of records | A standalone list that happens to sit next to other data |
| Undo | Ctrl+Z (Mac: ⌘Z) | Ctrl+Z (Mac: ⌘Z) |
Why Excel shows the Sort Warning#
Excel shows the Sort Warning when you select some cells, ask it to sort, and it finds data in a column right next to your selection. The usual trigger is selecting a whole column, or part of one, and clicking Sort A to Z on the Data tab (or Home > Sort & Filter).
The dialog says that Excel found data next to your selection, and that because you have not selected that data, it will not be sorted. It then asks what you want to do: Expand the selection or Continue with the current selection, with Sort and Cancel buttons. Excel for Mac shows the same choice.
Excel can't tell whether the column beside yours belongs with it. In a staff list, it nearly always does. That's why Expand the selection is the option already selected when the dialog opens.
The same staff list, sorted both ways#
Here is a small staff list. The task: sort it by name, A to Z.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | ID | Name | Department | Salary |
| 2 | 207 | Hannah Brooks | Marketing | 41,500 |
| 3 | 112 | Daniel Okafor | Finance | 58,200 |
| 4 | 319 | Sofia Rossi | Sales | 46,800 |
| 5 | 145 | Liam Chen | IT | 63,000 |
| 6 | 268 | Grace Mensah | HR | 44,900 |
You select B2:B6 and click Sort A to Z. The Sort Warning appears.
Result with Expand the selection#
Excel widens the sort to columns A to D and sorts the records by name. The header row stays at the top, and every row moves as one piece:
| A | B | C | D | |
|---|---|---|---|---|
| 2 | 112 | Daniel Okafor | Finance | 58,200 |
| 3 | 268 | Grace Mensah | HR | 44,900 |
| 4 | 207 | Hannah Brooks | Marketing | 41,500 |
| 5 | 145 | Liam Chen | IT | 63,000 |
| 6 | 319 | Sofia Rossi | Sales | 46,800 |
Daniel still works in Finance on 58,200. The data is correct, just in a new order.
Result with Continue with the current selection#
Excel sorts only B2:B6. Columns A, C and D stay exactly where they were:
| A | B | C | D | |
|---|---|---|---|---|
| 2 | 207 | Daniel Okafor | Marketing | 41,500 |
| 3 | 112 | Grace Mensah | Finance | 58,200 |
| 4 | 319 | Hannah Brooks | Sales | 46,800 |
| 5 | 145 | Liam Chen | IT | 63,000 |
| 6 | 268 | Sofia Rossi | HR | 44,900 |
Now Daniel appears to work in Marketing on 41,500, and Hannah in Sales on 46,800. Four of five people have the wrong ID, department and salary. Liam's row happens to be right, because his name was already fourth alphabetically. That makes the damage easier to miss: spot-check one row and it may look fine.
When to use Expand the selection#
Use Expand the selection whenever each row is one record: a person, an order, an invoice, a product. That covers almost every sort you will do at work:
- Staff, customer and product lists, where each row describes one thing.
- Transaction logs, where the date, amount and reference must stay together.
- Any data you will later look up, total or chart, because those all rely on rows being intact.
One limit: Excel expands to the current region, the block of filled cells around your selection, and stops at a completely blank column or row. If column E is empty and column F holds start dates, Expand the selection sorts A:D and leaves F behind. Delete the blank column, or select the full range yourself first. For sorting by more than one column, see how to sort by multiple columns.
When to use Continue with the current selection#
Use Continue with the current selection only when the selected cells are an independent list that doesn't relate to the columns beside it. For example, a list of department names for a drop-down that someone typed next to the staff table. Sorting that list on its own is safe, because no row links it to its neighbours.
Even then, the better fix is to move the list away, with a blank column in between, so the warning never appears and nobody else picks the wrong option later. Microsoft's own advice is to let Excel expand the selection when you're unsure.
How to decide: a quick checklist#
Answer these before you click Sort:
- Does each row describe one person, order or item? Yes → Expand the selection.
- Would a value in the next column be wrong if it moved to a different row? Yes → Expand the selection.
- Is the selected column a separate list that has nothing to do with its neighbours? Yes → Continue with the current selection, or better, move it away first.
- Are you unsure? Choose Expand the selection; Undo can reverse it.
- Is there a blank column inside your data? Yes → select the whole range yourself, or Expand the selection will leave part of it behind.
How to avoid the warning, and how to spot a scrambled sort#
You can sidestep the dialog entirely:
- Click one cell in the column you want to sort, not the whole column. Excel then sorts the whole block automatically.
- Select the full range (for example A1:D6, or press Ctrl+A on Windows or ⌘A on a Mac inside the data) before you open Data > Sort.
- Convert the range to a table with Ctrl+T (Mac: ⌘T). In a table, sorting with the header's filter arrow always sorts whole rows. Our table vs range comparison explains the other benefits.
- Use the SORT function in Microsoft 365 or Excel 2021 and later to make a sorted copy without touching the original; see the Sort button vs the SORT function.
If you suspect a sort went wrong, press Ctrl+Z (Mac: ⌘Z) at once. Undo reverses the last sort whichever option you chose. If it's too late for Undo, check the data:
- Don't trust the totals.
=SUM(D2:D6)is still 254,400, because no salary was lost, only moved. - Check a known record by ID.
=XLOOKUP(207,A2:A6,B2:B6)should return Hannah Brooks. After the bad sort it returns Daniel Okafor. - Compare against a backup or the source system, row by row, using the ID column.
- Restore a version. For files on OneDrive or SharePoint, use File > Info > Version History.
Before a big sort, adding a column of original row numbers (1, 2, 3…) lets you sort back to the starting order later, as long as that column is sorted with everything else. The guide on why Excel sort is not working covers other sort problems, such as numbers stored as text.
What a job test usually checks#
A sorting task in an Excel test is rarely just about the order. Later questions often depend on the sorted data, such as finding the top salary in a department or totalling by region. If one column was sorted alone, every one of those answers is wrong, even though the sort itself "looks" right. After sorting, check two or three rows against what you saw before: same ID, same name, same salary.
Our recommendation#
Choose Expand the selection unless you are certain the selected cells are a standalone list. Better still, avoid the question: click a single cell before sorting, or keep your data in an Excel table, and the warning won't appear at all. If you ever do pick Continue with the current selection by mistake, Undo it immediately. Our step-by-step guide on how to sort data in Excel covers custom sorts and header rows.
Practise it#
Try the check-formula exercise on this page to see how a scrambled sort shows up. Then practise sorting and filtering a table in a live spreadsheet, where each sort keeps your rows together.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
Someone sorted only the Name column of this staff list and chose Continue with the current selection. HR records say employee 207 is Hannah Brooks. In G2, use XLOOKUP to return the name now on ID 207's row, to check whether the list was scrambled.
| A | B | C | D | E | F | G | H | |
|---|---|---|---|---|---|---|---|---|
| 1 | Salary | Name now on that row | ||||||
| 2 | ||||||||
| 3 | ||||||||
| 4 | ||||||||
| 5 | ||||||||
| 6 | ||||||||
| 7 | ||||||||
| 8 | ||||||||
| 9 |
Tip: Look up the ID in F2 in the ID column (A2:A6) and bring back the matching cell from the Name column (B2:B6).
Practise this in a lesson
Frequently asked questions
What does Expand the selection mean when sorting in Excel?
It tells Excel to include the neighbouring columns in the sort. Excel extends your selection to the whole block of data around it, so every row moves as one unit and stays correct.
What happens if I choose Continue with the current selection?
Excel sorts only the cells you selected and leaves the other columns where they were. Each sorted value ends up on a different row from the data it belonged to, and Excel gives no further warning.
How do I undo a sort that mixed up my data?
Press Ctrl+Z on Windows or Command+Z on a Mac straight away. If the file is saved on OneDrive or SharePoint, you can also restore an earlier copy from File > Info > Version History.
How do I stop the Sort Warning from appearing?
Click a single cell in the column instead of selecting the whole column, or select the full data range before sorting. Converting the range to an Excel table also keeps rows together when you sort.
Why didn't Expand the selection include all my columns?
Excel expands to the block of data around your selection and stops at a completely blank column or row. Delete the empty column, or select the full range yourself before sorting.