Excel guide · 4 min read
Excel dates not sorting correctly: how to fix it
Sample data
Every result on this page was calculated from this sheet by the same spreadsheet engine the Cellwise app uses.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Invoice date | Customer | Amount | From EU system | |
| 2 | 01/15/2026 | Harlow Dental | 1240 | 28.02.2026 | |
| 3 | 11/03/2025 | Brightside Cafe | 385.5 | 05.11.2025 | |
| 4 | 02/28/2026 | Pine & Co | 2150 | ||
| 5 | 12/19/2025 | Northgate Gym | 760 | ||
| 6 | 10/07/2025 | Kessler Law | 3125 | ||
| 7 | 03/04/2026 | Odd Fellows Bakery | 512.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.
Result: spills 6 rows × 3 columns
| 01/15/2026 | Harlow Dental | 1240 |
| 02/28/2026 | Pine & Co | 2150 |
| 03/04/2026 | Odd Fellows Bakery | 512.75 |
| 10/07/2025 | Kessler Law | 3125 |
| 11/03/2025 | Brightside Cafe | 385.5 |
| 12/19/2025 | Northgate Gym | 760 |
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.
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.
- Select the date column (A2:A7).
- Go to Data > Text to Columns.
- Choose Delimited and click Next.
- Clear all the delimiter boxes and click Next.
- Under Column data format, choose Date and pick the order the text uses: MDY for 01/15/2026, DMY for 15/01/2026.
- 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.
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.
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
SORTSorts a range, spillsISTEXTIs it text?VALUEText to numberDATEBuilds a dateRIGHTCharacters from the endMIDCharacters from the middleLEFTCharacters from the startTRIMRemoves extra spaces
Related guides
- How to convert numbers stored as text in Excel
- How to remove spaces in Excel
- How to calculate days between two dates in Excel
- #VALUE! error in Excel: causes and fixes
- How to get the day of the week from a date in Excel
- How to remove duplicates in Excel
- How to add leading zeros in Excel
Updated