Troubleshooting· 10 min read

Excel Sort Not Working? 8 Fixes for Dates, Numbers, and Mixed Data

When Excel sort produces wrong or incomplete results, the cause is almost always in the data, not the sort settings. Blank rows, merged cells, numbers or dates stored as text, partial selections, and protected sheets all break sorting in ways that are easy to miss and easy to fix once identified.

Quick Diagnosis: What Kind of Sort Problem Do You Have?

Sort problems fall into a few clear categories. Identifying yours narrows the fix immediately:

  • Only some rows sorted: A blank row split the range, or only one column was selected. → See Fix 1 and Fix 2.
  • Numbers sorted like text (1, 10, 2, 20): Numbers are stored as text. → See Fix 3.
  • Dates sorted alphabetically or randomly: Dates are stored as text. → See Fix 4.
  • Sort produced scrambled, mismatched rows: Only one column was sorted while related columns stayed behind. → See Fix 2.
  • Sort option is grayed out: Sheet is protected or the workbook is shared in a way that prevents sort. → See Fix 8.
  • Sort worked but some rows are in the wrong position: Merged cells in the sort range. → See Fix 5.

Fix 1: Remove Blank Rows Inside the Data

A blank row inside a dataset causes Excel to stop the sort range at the blank row. Rows below the blank may be excluded from the sort entirely, staying in their original position while rows above them are rearranged.

To check: look for any completely empty rows within your data. Use Remove Blank Rows to clean the dataset, or manually select the blank row and delete it using right-click > Delete Row.

After removing blank rows, convert the range to a Table with Ctrl + T. Tables define a firm range boundary and prevent blank rows from splitting the sort region in future imports.

Fix 2: Sort the Full Table, Not Just One Column

This is one of the most destructive sort mistakes. If you select only column B and sort, only the values in column B move. All other columns stay in their original positions. The result is mismatched rows — prices no longer correspond to the right products, names no longer match the right IDs.

The correct approach: click anywhere inside the data — do not select just one column — then go to Data > Sort. Excel will automatically select the full connected range and sort all columns together.

If you accidentally sorted a single column, press Ctrl + Z immediately to undo before making any other changes.

Fix 3: Fix Numbers Stored as Text

Text-formatted numbers are recognizable by two signs: a small green triangle in the top-left corner of the cell, or numbers that sort alphabetically instead of numerically (1, 10, 100, 2, 20, 3 instead of 1, 2, 3, 10, 20, 100).

The fastest fix: select the affected column, go to Data > Text to Columns, click Finish without changing any settings. This forces Excel to reinterpret the values as numbers without changing the displayed values.

Alternative: multiply by 1 in a helper column (=A2*1) to force numeric conversion, paste the helper values back over the original column, then delete the helper.

For large imports, the full guide to numbers stored as text covers all conversion methods including Power Query.

Fix 4: Fix Dates Stored as Text

Text dates are the trickiest sort problem because they look exactly like real dates. The giveaway: dates sort alphabetically (January 2026, February 2025, March 2024 instead of 2024, 2025, 2026) or in an inconsistent order that makes no chronological sense.

Check whether a date is real: click a date cell and look at the formula bar. A real Excel date is a number (serial date), and the cell will show a number when you change the format to General. A text date remains text regardless of format.

Method 1: Text to Columns

  1. Select the date column.
  2. Go to Data > Text to Columns.
  3. Click Next twice, then in the Column Data Format step select Date and choose the format matching your text dates (MDY, DMY, YMD).
  4. Click Finish. Excel converts the text to real dates.

Method 2: DATEVALUE formula

=DATEVALUE(A2)

Apply in a helper column, then paste values back. Format the column as Date after converting.

Fix 5: Unmerge Cells in the Sort Range

Merged cells and sorting are fundamentally incompatible. A merged cell that spans rows 2 and 3 contains data only in the first row — row 3 is effectively empty. When you try to sort, Excel either shows an error ("This operation requires the merged cells to be identically sized") or produces unexpected results where merged rows move as a block.

To fix: select the sort range, go to Home > Merge & Center (click the dropdown and choose Unmerge Cells). Then use Home > Fill > Down to fill the now-empty cells with the value from the merged cell above. Sort after unmerging.

As a design principle: avoid merging cells in any row that will need to be sorted or filtered. Use Center Across Selection instead of Merge & Center if you need centered headings without merging.

Fix 6: Handle Mixed Data Types in the Sort Column

When a sort column contains a mix of real numbers and text values, Excel sorts them in separate groups: text values first (or last depending on the sort direction), then numbers. This can look like a partial or incorrect sort.

Use the Column Statistics tool to identify how many values in a column are stored as numbers versus text. Once identified, normalize the column to a single consistent data type before sorting.

Fix 7: Fix the Header Row Setting

If Excel includes your header row in the sort — so the header "Customer Name" gets sorted into the middle of the data — check the My data has headers checkbox in the Sort dialog. When checked, Excel excludes the first row from the sort.

The reverse problem: if the first data row is being treated as a header and excluded from the sort, uncheck My data has headers. Excel sometimes guesses wrong when the first data row contains text that could look like headers.

Fix 8: Check Sheet Protection

If the Sort option in the Data tab is grayed out, the sheet may be protected. Go to Review > Unprotect Sheet and enter the password if prompted. After unprotecting, sorting should become available again.

If you do not know the password, you cannot unprotect the sheet. Contact whoever set the protection, or ask the original file owner to unprotect it before sending for analysis.

After Sorting: Verify the Results

After any sort, especially on important data, verify several known records to confirm rows stayed together:

  • Check that customer names still match their correct IDs and email addresses.
  • Check that product codes still match the correct prices and descriptions.
  • Check that totals in summary rows still correspond to the correct categories.
  • Spot-check the first, last, and a few middle rows.

If anything looks mismatched, press Ctrl + Z immediately to undo the sort before making further changes.

Preventing Sort Problems in Future

  • Convert data ranges to Excel Tables with Ctrl + T. Tables protect against blank-row range issues and partial column selection.
  • Never merge cells in data rows. Use formatting alternatives instead.
  • Validate imported data with Column Statistics to catch mixed data types before sorting.
  • Always click inside the table (not just one column) before sorting.

Frequently Asked Questions

Why does Excel sort work on small datasets but not large ones?

Large imported datasets are more likely to contain mixed data types, blank rows, or text-formatted numbers because they come from external systems that do not enforce consistent formatting. The sort problems were always there — they just become obvious at scale when more rows are affected.

Does Excel sort alphabetically or numerically by default?

Excel detects the column type and sorts accordingly. A column of real numbers sorts numerically. A column of text sorts alphabetically. A column with mixed types splits into groups — text sorted alphabetically, then numbers sorted numerically (or vice versa). The mixed behavior is the most common sign of a data quality problem rather than a sort setting problem.

How do I sort by multiple columns in Excel?

Go to Data > Sort and click Add Level to add a second (and third) sort key. The first level is the primary sort, and each additional level breaks ties from the level above. See How to Sort Excel by Multiple Columns for the full guide.

Sort Excel safely online

Sort by up to three columns and download a clean copy without touching your original file.

Open Sort Excel Tool →