Excel — dates stored as text

Dates won't sort in the right order in Excel — dates stored as text fix

You sort the date column and January 9th ends up after January 10th. That's not a sort bug — it's Excel sorting the dates as plain text, character by character, because they were never converted into real date values. Drop your file in below to see which date cells are actually text in disguise.

clean-export · xlsx-for-ai

A real date is a number, not text that looks like one

Under the hood, every genuine Excel date is a serial number — January 1, 1900 is day 1, and everything else counts up from there. What you see (1/9/2026, 09-Jan-26, whatever format) is just a display mask over that number. Sorting compares the numbers, so chronological order and sort order always agree.

Why imported dates break this

CSV files, database exports, and copy-pasted tables carry dates as plain text strings, and Excel doesn't always auto-convert them on open or paste — especially if the format is ambiguous (day/month vs. month/day) or inconsistent row to row. A text-stored date is left-aligned and has no serial number behind it at all, even though it displays exactly like a real date.

Why the sort order looks scrambled

Sorting a text column compares strings character by character, left to right — not as calendar values. 1/9/2026 and 1/10/2026 are compared starting at the third character: 9 versus 1. Since 9 is "greater" as a character, 1/9/2026 sorts after 1/10/2026, even though January 9th comes first on the calendar. The more dates in the column, the more scrambled this looks.

How to convert and fix it

Select the column, go to Data → Text to Columns, click Finish on step 1 (no delimiter changes needed) but set the column data format to Date on the final step — Excel will convert the recognized text into real serial-numbered dates in place. Alternatively, a helper column with =DATEVALUE(A1) does the same conversion without touching the original. Upload your file above first to see exactly which date cells are text-formatted before you convert.

More Clean up a messy Excel export — free. guides

← All Clean up a messy Excel export — free. guides