Cellwise Try it free

Excel guide · 4 min read

Excel dates not sorting correctly: how to fix it

Quick answerIf Excel sorts 10/07/2025 after 03/04/2026, your dates are text, not real dates, so Excel sorts them alphabetically, character by character. Convert them: select the column, go to Data > Text to Columns, click Next twice, choose Date with the right order (MDY or DMY) and click Finish. Then sort again.

Sample data

Every result on this page was calculated from this sheet by the same spreadsheet engine the Cellwise app uses.

ABCDE
1Invoice dateCustomerAmountFrom EU system
201/15/2026Harlow Dental124028.02.2026
311/03/2025Brightside Cafe385.505.11.2025
402/28/2026Pine & Co2150
512/19/2025Northgate Gym760
610/07/2025Kessler Law3125
703/04/2026Odd Fellows Bakery512.75

Why text dates sort in the wrong order

A real Excel date is a number (1 January 2026 is 46023) shown in a date format, so it sorts by time. A text date is just characters. Text sorts from the first character: "01/15/2026" comes before "10/07/2025" because 0 comes before 1, regardless of the year.

The result looks almost right, sorted by month, with the years jumbled. That is the giveaway. These invoice dates came from a web export as text.

=SORT(A2:C7)

Result: spills 6 rows × 3 columns

01/15/2026Harlow Dental1240
02/28/2026Pine & Co2150
03/04/2026Odd Fellows Bakery512.75
10/07/2025Kessler Law3125
11/03/2025Brightside Cafe385.5
12/19/2025Northgate Gym760

SORT (Excel 365 and 2021) orders them 01/15/2026, 02/28/2026, 03/04/2026, 10/07/2025, 11/03/2025, 12/19/2025: by month, with 2025 after 2026.

How to tell a date is text

Several quick signs. Text is left-aligned by default, real dates are right-aligned. The filter drop-down on the column offers Sort A to Z instead of Sort Oldest to Newest and does not group by year. Selecting the column shows a Count in the status bar but no Sum. Changing the number format does nothing.

For a definite answer, use ISTEXT. It returns TRUE for a text date and FALSE for a real one.

=ISTEXT(A2)

Result: TRUE

TRUE: the invoice date in A2 is text, so it will not sort as a date.

Fix 1: Text to Columns (best for a whole column)

Text to Columns converts the cells in place, without helper columns or formulas, and lets you tell Excel the order of day and month. It is the most reliable fix, especially for imports in a different regional format.

  1. Select the date column (A2:A7).
  2. Go to Data > Text to Columns.
  3. Choose Delimited and click Next.
  4. Clear all the delimiter boxes and click Next.
  5. Under Column data format, choose Date and pick the order the text uses: MDY for 01/15/2026, DMY for 15/01/2026.
  6. Click Finish. The dates jump to the right of the cells. Apply a date format if needed, then sort.

Fix 2: VALUE or DATEVALUE in a helper column

=VALUE(A2) converts a text date into the date's serial number; format the result as a date. DATEVALUE(A2) does the same but only accepts text, and returns #VALUE! if the cell is already a real date. VALUE handles both, so it is safer on a column that is partly converted.

Both read the text using your computer's regional settings. On a US system "03/04/2026" becomes 4 March 2026. On a UK system the same text becomes 3 April, and "01/15/2026" fails with #VALUE! because there is no month 15. If your data comes from a different region, use Fix 3. After converting, copy the helper column and use Paste Special > Values over the original.

=VALUE(A2)

Result: 46037

On US regional settings, "01/15/2026" becomes 46037, which shows as 15 January 2026 once formatted as a date.

Fix 3: DATE with text functions (any region)

When the text order does not match your settings, take the pieces apart yourself. The European system in column E writes 28.02.2026. RIGHT takes the year, MID the month, LEFT the day, and DATE builds a real date from them. This works the same on every computer.

Adjust the positions to your format: for US text like 01/15/2026, use =DATE(RIGHT(A2,4),LEFT(A2,2),MID(A2,4,2)). If days and months are not always two digits (3/5/2026), Text to Columns is easier.

=DATE(RIGHT(E2,4),MID(E2,4,2),LEFT(E2,2))

Result: Feb 28, 2026

"28.02.2026" becomes the real date 28 February 2026.

Still sorting oddly after converting?

Mixed columns are the usual culprit. If some cells converted and others did not, an ascending sort puts all the real dates first and the text ones after them, because Excel sorts numbers before text. Run ISTEXT down the column and convert the stragglers.

Also check that you sorted the whole table: when Excel asks, choose Expand the selection, or the dates are sorted while customers and amounts stay where they were. Leading spaces from imports keep a date as text too; remove them with TRIM before converting.

Common mistakes

Changing the cell format and expecting it to fix the dates

Formatting changes how a number is shown. It cannot turn text into a number. Convert with Text to Columns, VALUE or DATE.

Using VALUE on dates from another country

VALUE and DATEVALUE follow your regional settings and can swap day and month without an error. Use Text to Columns with DMY or MDY, or build the date with DATE.

Sorting one column on its own

Choose Expand the selection, or select the whole table before sorting, so each row stays together.

FAQ

Why won't Excel sort my dates by oldest to newest?

The dates are stored as text, so Excel only offers A to Z sorting. Convert them to real dates with Data > Text to Columns (choose Date in step 3) and the Oldest to Newest option appears.

Why does Excel sort dates by month instead of year?

Text dates in month/day/year form sort character by character, so the month digits decide the order. Convert them to real dates and they sort by year, month and day.

How do I convert text to date in Excel?

Use Data > Text to Columns with the Date option, =VALUE(A2) or =DATEVALUE(A2) in a helper column, or =DATE(RIGHT(A2,4),MID(A2,4,2),LEFT(A2,2)) for day-first text.

Why do some dates sort correctly and others don't?

The column is mixed: some cells are real dates and some are text. Excel sorts numbers before text, so the text dates end up at the bottom. Check with ISTEXT and convert those cells.

Functions used

Related guides

Updated