ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Comparisons
  3. Excel Sort Warning: Expand the Selection vs Current Selection

Excel Sort Warning: Expand the Selection vs Current Selection

By ExcelReady Team·Updated December 1, 2026·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+
  1. Expand the selection vs current selection at a glance
  2. Why Excel shows the Sort Warning
  3. The same staff list, sorted both ways
  4. When to use Expand the selection
  5. When to use Continue with the current selection
  6. How to decide: a quick checklist
  7. How to avoid the warning, and how to spot a scrambled sort
  8. What a job test usually checks
  9. Our recommendation
  10. 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.

FeatureExpand the selectionContinue with the current selection
What gets sortedThe whole block of data around your selectionOnly the cells you selected
Rows stay togetherYesNo
Default option in the dialogYesNo
RiskLow; it may miss columns past a blank columnHigh; records no longer match
Excel warns you afterwardsNot neededNo, the damage is silent
Right forAlmost every sort of a table of recordsA standalone list that happens to sit next to other data
UndoCtrl+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.

ABCD
1IDNameDepartmentSalary
2207Hannah BrooksMarketing41,500
3112Daniel OkaforFinance58,200
4319Sofia RossiSales46,800
5145Liam ChenIT63,000
6268Grace MensahHR44,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:

ABCD
2112Daniel OkaforFinance58,200
3268Grace MensahHR44,900
4207Hannah BrooksMarketing41,500
5145Liam ChenIT63,000
6319Sofia RossiSales46,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:

ABCD
2207Daniel OkaforMarketing41,500
3112Grace MensahFinance58,200
4319Hannah BrooksSales46,800
5145Liam ChenIT63,000
6268Sofia RossiHR44,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:

  1. Does each row describe one person, order or item? Yes → Expand the selection.
  2. Would a value in the next column be wrong if it moved to a different row? Yes → Expand the selection.
  3. 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.
  4. Are you unsure? Choose Expand the selection; Undo can reverse it.
  5. 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.

fx
ABCDEFGH
1
ID
Name
Department
Salary
Check ID
Name now on that row
2
207
Daniel Okafor
Marketing
41500
207
3
112
Grace Mensah
Finance
58200
4
319
Hannah Brooks
Sales
46800
5
145
Liam Chen
IT
63000
6
268
Sofia Rossi
HR
44900
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

LessonFilter a tableTurn on filter buttons with Ctrl+Shift+L, filter by one or several values and by a number condition, total and count only the visible rows with SUBTOTAL, then clear the filters.

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.

Sources

  • Expanding a selection while sorting data or removing duplicates - Microsoft Support
  • Sort data in a range or table in Excel - Microsoft Support
  • Keyboard shortcuts in Excel - Microsoft Support

Written and checked by the ExcelReady Team. First published December 1, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. Expand the selection vs current selection at a glance
  2. Why Excel shows the Sort Warning
  3. The same staff list, sorted both ways
  4. When to use Expand the selection
  5. When to use Continue with the current selection
  6. How to decide: a quick checklist
  7. How to avoid the warning, and how to spot a scrambled sort
  8. What a job test usually checks
  9. Our recommendation
  10. Practise it

Keep reading

Data tools· 6 min read

How to Sort Data in Excel by One or More Columns

To sort data in Excel by one column, click any cell in that column and choose Data > Sort A to Z or Sort Z to A. To sort by several columns, choose Data > Sort, pick the first column, then click Add Level for the next one. Click a single cell first so Excel keeps each row together.

Errors & fixes· 6 min read

Excel Sort Not Working? Causes and Quick Fixes

When Excel sort is not working, the data is usually the problem, not the sort. Numbers or dates stored as text sort in the wrong order, leading spaces push rows to the top, merged cells block the sort, and blank rows stop Excel from selecting the whole table. Clean the column with TRIM and VALUE, unmerge cells, then sort again.

Comparisons· 7 min read

Sort Button vs SORT Function in Excel

The Sort button on the Data tab rearranges the rows of your table in place, once, and works in every version of Excel. The SORT function leaves the original data alone and returns a sorted copy that updates when the data changes, but it needs Excel 2021, Excel 2024, Microsoft 365 or Excel for the web.

More on comparisons

  • SORT vs SORTBY in Excel: Which Dynamic Sort
  • STDEV.S vs STDEV.P: Sample or Population?
  • SUBSTITUTE vs REPLACE in Excel
  • SUBTOTAL vs AGGREGATE in Excel: Totals That Skip Rows
  • SUBTOTAL vs SUM in Excel: Totals That Respect Filters
  • SUMIF vs COUNTIF: Totals vs Counts
All comparisons articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free