Excel Performance Problems

Fix Excel Not Sorting All Rows in a Data Range

Algirdas JasaitisAlgirdas Jasaitis Nov 12, 2026 869 views

Question details

The user needs to sort an entire Excel dataset when the final records are excluded from the sort operation.

Fix Excel Not Sorting All Rows in a Data Range
Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet with a large data range sorts correctly in smaller sections, but the last few rows are not included.
Observed behavior
Excel stops the selected sort range before the final records, leaving those rows unchanged.
Before you start

Click a cell in the dataset and check whether blank rows or blank columns divide the final records from the main table. Ensure the row that contains your field names is the only header row in the range.

Solution 1Recommended

Select the complete Excel range before sorting

Use this when Excel detects only part of the table or leaves the final rows unchanged after a sort.

Excel can sort far more than 10,000 rows. When only some rows are sorted, the usual cause is that Excel identified a smaller current region because the data is separated by an empty row, empty column, or incomplete selection.

1
Check the table boundaries

Click a cell in the main dataset, then press Ctrl+A once to select the current data region. Confirm that the selection includes the last records that were previously excluded.

2
Remove blank separators

Look between the main records and the excluded rows for a fully blank row or column. Delete the blank separator, or select the complete range manually by dragging from the first header cell through the final used row and column.

3
Open the Sort dialog

On the Data tab, select Sort. If your selected range includes field names, select the My data has headers check box.

4
Expand the selection if prompted

If Excel displays a Sort Warning, choose Expand the selection and select Sort so that every related column and row moves together.

Select the complete Excel range before sorting
Expected result: The full selected range, including the final records, is sorted together without leaving rows behind.
Sort complete data ranges with WPS Spreadsheets

Sort Every Row in a Spreadsheet with WPS Office

WPS Spreadsheets lets you select the full dataset, expand the sort range, and sort records by one or more columns. Its familiar spreadsheet interface helps you review blank separators and clean inconsistent values before sorting.

  1. 1. Open the workbook in WPS Spreadsheets: Launch WPS Office, choose Spreadsheets, and open the affected .xlsx or .xls workbook.
  2. 2. Select the full dataset: Drag from the header row to the last record, ensuring no blank row or blank column separates the selected data.
  3. 3. Start the sort command: Go to the Data tab and select Sort, then choose the column and order you want to use.
  4. 4. Confirm the header and range settings: Enable the header option when the first row contains labels, then confirm that the displayed range includes every record.
  5. 5. Apply the sort: Select OK to sort all selected rows together and verify that the final records moved with the table.
Sort full data ranges by a selected column or multiple sort levels.Use formulas such as LEN, TRIM, CLEAN, MID, and UNICODE to investigate hidden characters.Open, edit, and save Microsoft Excel .xlsx and .xls files with format compatibility.Use a lightweight, easy-to-navigate spreadsheet workspace for large tables.
microsoft office alternative - wps office

Frequently Asked Questions

Can Excel sort more than 10,000 rows?

Yes. Excel can sort datasets larger than 10,000 rows. If the last rows are excluded, check the selected range and look for blank rows or columns that split the dataset.

Why does Excel stop selecting my table before the last rows?

Excel's current-region selection stops at a completely blank row or column. Remove the separator or manually select the entire range before choosing Data > Sort.

What should I choose in the Excel Sort Warning dialog?

Choose Expand the selection when the adjacent columns belong to the same records. This keeps each row intact while Excel sorts the chosen column.

How can I find invisible characters that affect Excel sorting?

Use =LEN(cell) to compare character counts. To inspect a character code, use =UNICODE(MID(cell,position,1)); TRIM and CLEAN can remove many unwanted spaces and non-printing characters.

Why do numbers sort as text in Excel?

Numbers stored as text may sort alphabetically rather than numerically. Use Data > Text to Columns > Finish, or convert the values to numbers and then run the sort again.