Here's something most people don't realize: Excel doesn't store dates as "January 15, 2024" or "15/01/2024." It stores them as plain numbers โ called serial numbers. January 1, 1900 is serial number 1. January 1, 2024 is serial number 45,292. Every day is just one number higher than the previous. That's it.
This design is what makes sorting dates so powerful. When your dates are real Excel dates, sorting them is no different from sorting any other number column โ Excel lines up the serial numbers in order, lowest to highest or highest to lowest, and you get your dates in perfect chronological sequence. It works instantly, every time.
The problem? Not every value that looks like a date in your spreadsheet is actually stored as a date. If you import data from a CSV, copy from a web page, or receive a file from an external system, those values might be stored as text strings. "01/15/2024" typed as text and "01/15/2024" stored as a real Excel date look identical on screen โ but only one of them will sort correctly.
Understanding the difference isn't just academic. When you sort real Excel dates, they always go in the right order because you're really sorting numbers. When you sort text that looks like dates, Excel falls back to alphabetical sorting โ character by character, left to right. That's why you sometimes see 2023 dates appearing after 2024 dates, or months out of order. The dates look right but they're not behaving like dates at all.
You can also bookmark our excel reference for shortcuts and formulas you'll use every day. And if you want a broader overview of all sorting types, the how to sort by date in Excel article covers the full landscape โ this guide goes deeper on the date-specific issues.
Basic sort: Select your date column โ Data tab โ Sort Oldest to Newest (or use the AโZ button). For newest first, click Sort Newest to Oldest.
Dates not sorting correctly? They're almost certainly stored as text, not real date values. The giveaway: dates are left-aligned in the cell instead of right-aligned. Fix with Data โ Text to Columns โ Finish to convert them to real dates, then sort again.
Sort a date column from oldest to newest or newest to oldest in seconds.
Put the most recent dates at the top โ common for logs, transactions, and timelines.
When dates look right but sort wrong, they're stored as text. Two ways to fix it.
Extract just the month or day-of-week with a helper column, then sort by that.
If your dates are stored correctly as Excel date values, sorting them is genuinely straightforward. Here's exactly how to do it.
Click any cell inside your date column โ you don't need to select the whole column. Then go to the Data tab in the ribbon. You'll see two buttons in the Sort & Filter group: Sort Oldest to Newest (AโZ with a calendar icon) and Sort Newest to Oldest (ZโA icon). Click the one you want.
If your data has multiple columns, Excel will ask whether to expand the selection (sort all columns together, keeping each row intact) or continue with only the date column. Always choose Expand the selection โ sorting just the date column scrambles the rest of your data. After sorting, scan the first few rows to verify the order makes sense.
No mouse needed. Place your cursor anywhere in the date column, then press each key in sequence:
Alt โ A โ S โ AAlt โ A โ S โ DAlt activates the ribbon, A goes to the Data tab, S opens Sort & Filter, and A/D selects ascending or descending. Works in Excel 2007 and later. You can also right-click a date cell โ Sort โ Sort Oldest to Newest โ quicker when you're already in the right area.
Formatted as a Table (Ctrl+T)? Click the dropdown arrow in your date column header โ Sort Oldest to Newest is right at the top. One click. Tables also keep row relationships intact automatically, so the expand-selection warning never appears. Add new rows and they slot into the sort order without any extra steps.
Go to Data โ Sort (the full dialog). Click Add Level. Set the first key to your date column (Oldest to Newest), the second to another column โ name, priority, or anything else. Excel sorts the primary column first, then within ties it sorts by the secondary column. You can chain up to 64 levels.
Our guide on sort a column in Excel covers multi-key sorts in detail, and the principles for sort alphabetically in Excel apply directly to any text column you'd use as a tiebreaker.
Steps:
Keyboard shortcut: Alt โ A โ S โ A
In a Table: Click the column header dropdown โ Sort Oldest to Newest
Common mistake: Selecting only the date column without expanding โ this sorts dates but leaves all other columns in their original order, breaking the row relationships. Always expand the selection unless you have a single-column dataset.
Why it happens: Dates imported from CSV, web, or external systems often arrive as text strings. They look like dates but Excel doesn't treat them as dates.
Method 1 โ Text to Columns (fastest):
Method 2 โ DATEVALUE formula:
=DATEVALUE(A1)
Returns the serial number for a text date. Copy the formula down, then paste as values (Ctrl+Shift+V โ Values), replace the original column, and format as Date.
Common mistake: After using DATEVALUE, people forget to paste as values and delete the original column โ leaving formulas that reference deleted cells. Paste as values first, then delete the originals.
Why you'd do this: Sometimes you want to group all January dates together regardless of year, or group all Mondays regardless of month.
Sort by month (ignoring year):
=MONTH(A2) โ returns 1 (January) through 12 (December)Sort by day of week:
=WEEKDAY(A2) โ returns 1 (Sunday) through 7 (Saturday), or use =WEEKDAY(A2,2) for 1=Monday through 7=SundayExcel 365 dynamic sort:
=SORT(A2:B10, 1, 1) โ sorts range A2:B10 by column 1, ascending. No helper column, updates automatically.
Common mistake: Forgetting to delete or hide the helper column after sorting โ it can confuse other users who inherit the file.
This is the most-searched question in the Excel date space โ and for good reason. You click Sort Oldest to Newest and the dates come out in a seemingly random order. Or the sort looks like it worked, but 2023 dates appear after 2024 dates. Or January appears before December but June appears in the middle. What's happening?
In almost every case, the answer is the same: your dates are stored as text, not as real date values. The sort by date excel not working problem has one root cause in 90% of cases, and this is it.
Real Excel dates are right-aligned in the cell by default โ just like numbers, because that's what they are underneath. Text values are left-aligned by default. So the quickest visual check: look at how your dates sit in the cell. Left-aligned? Almost certainly text. Right-aligned? Probably real dates.
For a definitive test, use the ISNUMBER function in a blank cell next to your date:
=ISNUMBER(A1)
If this returns TRUE, your date is a real numeric date value. If it returns FALSE, it's stored as text โ and it won't sort correctly. This is the most reliable diagnostic available.
A third test: try formatting the cell as a number (Home โ Number Format โ Number). A real date will show its serial number (something like 45292). A text date will just show the text string unchanged, because changing the format of a text cell has no effect on how Excel reads it.
You can also look for the small green triangle in the upper-left corner of a cell. That triangle is Excel's warning icon for "number stored as text" โ it appears when Excel suspects the cell contains something that looks numeric or date-like but is formatted as text. Click the cell, then click the yellow warning diamond that appears to the left, and choose "Convert to Number" from the dropdown.
When Excel sorts text, it sorts alphabetically โ character by character from left to right. So "01/15/2024" sorts before "02/01/2023" because "01" comes before "02" alphabetically, even though February 2023 is actually earlier. If your dates are in MM/DD/YYYY format, the sort puts them in month order, ignoring the year entirely. If they're in DD/MM/YYYY format, they sort by day. Neither is what you want.
This is why the underlying date format in Excel matters so much โ not just how the date displays, but what type of value it actually is. And the way Excel handles Excel date formatting can sometimes make text dates look identical to real dates on screen, which is what makes this problem so insidious and hard to spot without running the ISNUMBER test.
A few less-common culprits worth checking when ISNUMBER returns TRUE but dates still don't sort right:
=TRIM(A1) to remove them, then re-test.Once you've identified the issue, the fix is usually straightforward. The next section walks through both Text to Columns and DATEVALUE โ pick whichever suits your workflow. Most people find Text to Columns faster for a one-time fix, while DATEVALUE is better when you're building a repeatable process.
You've confirmed your dates are text. Now let's fix them. There are two main approaches โ Text to Columns for a bulk in-place fix, and DATEVALUE for a formula-based fix that gives you more control. Both work; which you use depends on your situation.
This is the go-to fix when you have a whole column of text dates to convert. Select the date column, then go to Data โ Text to Columns. The Convert Text to Columns Wizard opens.
In Step 1, select Delimited and click Next. In Step 2, uncheck all delimiter boxes โ we're not actually splitting the column, just passing through the wizard to access the date conversion option in Step 3. Click Next.
Step 3 is where the magic happens. Under Column data format, select Date from the radio buttons. Then choose your date format from the dropdown: MDY for month/day/year (US format), DMY for day/month/year (European), or YMD for ISO 8601 format. Getting this right matters โ choosing DMY for US-format dates will silently swap your days and months. Click Finish.
Excel converts all the selected cells from text to real date values, in place. No helper column needed. After the conversion, format the column as Date (Home โ Number โ Short Date or Long Date). Then sort โ you should see correct chronological ordering immediately.
DATEVALUE converts a text string that looks like a date into an Excel serial number. The syntax is simple:
=DATEVALUE(A1)
Put this in a blank column next to your dates and copy it down. You'll see serial numbers (like 45292) rather than formatted dates โ that's correct. DATEVALUE returns the underlying number. Format that column as a Date and the numbers become readable dates again.
Once you're happy with the results, copy the entire DATEVALUE column, then paste as values only โ Ctrl+Shift+V โ Values, or right-click โ Paste Special โ Values. This replaces the formulas with actual serial numbers. You can then delete the original text column and keep only the converted one.
DATEVALUE works well when you want to keep the original text dates visible for reference while building a clean sorted version alongside. For the full picture of Excel date manipulation โ DATEVALUE alongside TODAY, NOW, DATEDIF, EDATE, and others โ our Excel date formulas guide covers every major date function with examples.
After converting, verify it worked: run =ISNUMBER(A1) again on a few cells โ they should return TRUE, and the cells should now be right-aligned. If any still show FALSE, they contained non-standard formats the wizard didn't recognize. Handle those manually or use a custom DATEVALUE with string manipulation.
Sometimes you don't want to sort by the full date โ you want to group by month (all Januaries together regardless of year) or by weekday (all Mondays first, then Tuesdays). Standard date sorting won't do this. You need a helper column approach.
Sort by month only: Add a column with =MONTH(A2). This extracts the month as a number โ 1 through 12. Sort that helper column from smallest to largest and your data groups by calendar month, with all Januaries together, all Februaries together, and so on. If you want year as a tiebreaker within the same month, open the full Sort dialog and add a second level using a =YEAR(A2) helper.
Sort by day of week: Use =WEEKDAY(A2), which returns 1 (Sunday) through 7 (Saturday) by default. If you want Monday as 1, use =WEEKDAY(A2, 2). Sort the helper column 1โ7 to group all Sundays (or Mondays) at the top, then Tuesdays, through to the end of the week.
After sorting, hide the helper column (right-click โ Hide) rather than deleting it โ that way you can re-sort by it later without rebuilding the formula. You might also want to how to change column width in excel to keep your worksheet tidy with helper columns included.
Dynamic sort with SORT function (Excel 365 only):
=SORT(A2:B10, 1, 1)
This formula sorts the range A2:B10 by the first column, ascending (use -1 for descending). It spills the sorted results into adjacent blank cells and updates automatically whenever source data changes โ no manual re-sorting ever again. To sort by the second column instead: =SORT(A2:C10, 2, -1).
The SORT function is only available in Excel 365 and Excel 2021. Excel 2016 and 2019 don't have it โ use the helper column method instead.
Need to separate names before sorting by a text column? Our guide on separate first and last name in excel walks through that โ useful when you're building multi-level sorts with both date and name columns. And if you're working with date-based count conditions, the countifs excel guide shows how to combine COUNTIFS with date criteria for targeted analysis.
Select a cell in the date column. Data tab โ Sort Oldest to Newest. Check whether the result looks chronological.
Look at alignment (right = real date, left = text). Run =ISNUMBER(A1) โ TRUE means real, FALSE means text. If FALSE, proceed to step 3.
Select the date column. Data โ Text to Columns โ Delimited โ Next โ uncheck all delimiters โ Next โ select Date format (MDY/DMY/YMD) โ Finish.
After conversion, sort again with Data โ Sort Oldest to Newest. Check for expand selection prompt and confirm.
Scan first and last few rows. Confirm the earliest date is at the top (or bottom for newest-first). Run =ISNUMBER on a few cells to confirm real dates. Done.