How to Sort by Date in Excel: Step-by-Step Guide for 2026
Learn how to sort by date in Excel using built-in tools, custom orders, and formulas. Fix text-stored dates and sort tables, ranges, and pivot tables fast.

Sorting by date in Excel sounds simple until you click Sort A to Z and the rows scramble in ways that make zero sense. Maybe your January 2026 invoices end up underneath July 2024, or the column you swore was a date column refuses to cooperate. You are not doing anything wrong. Excel sorts what it sees, and a lot of date columns are not actually dates. They are text that looks like dates.
This guide walks you through every reliable way to sort by date in Excel, from the basic ribbon button to multi-level sorts, custom orders, and formula-driven approaches. You will also learn how to spot fake dates, fix them in seconds, and rescue tables that have already been sorted incorrectly. By the end, you will sort thousands of rows correctly the first time, every time.
Whether you are an analyst handling quarterly reports, an accountant chasing overdue invoices, or a project manager who lives in a Gantt-style schedule, the methods below cover Excel 365, Excel 2021, Excel 2019, and Excel for the web. Where a feature is version-specific, we call it out so you do not waste five minutes hunting for a button that is not there. The goal is to give you a complete mental model of how Excel handles dates, so the next time something looks broken, you know exactly what to check.
One more thing before we start. Excel stores dates as serial numbers, but it displays them however the cell is formatted. That gap between storage and display is the source of almost every weird date sorting problem you will ever encounter. Internalize it now and the rest of this guide will feel obvious.
Excel Date Sorting At a Glance
Before we get into the step-by-step instructions, it helps to understand what Excel is actually doing under the hood. Every date in Excel is stored as a serial number. January 1, 1900 is 1. January 1, 2026 is 46023. When you sort by date, Excel sorts those serial numbers, not the formatted text you see. That is why a column showing dates that look identical can sort in wildly different orders if some cells are real dates and others are text strings.
The single most important habit you can build is checking whether a date column contains actual dates or text. We show you three quick checks in the sections below. Once you make this a 10-second reflex, you will catch about 80 percent of sort failures before they happen, which beats undoing a 50,000-row sort any day.
Excel for Mac uses a slightly different epoch (January 1, 1904) by default in older workbooks, but modern files default to the 1900 epoch. If you ever see dates that are four years off after copying between systems, the epoch mismatch is the culprit. You can change it under File > Options > Advanced > When calculating this workbook.

Click any cell in your date column. If the value aligns to the right by default, it is a real date or number. If it aligns to the left, it is text and will not sort chronologically. You can also press Ctrl+1 to open Format Cells; real dates show under the Date category with a serial number preview at the bottom. A third check: type =ISNUMBER(A2) in a blank cell where A2 is your date. TRUE means real date, FALSE means text.
Now that you know what to look for, let's walk through the main scenarios you will face. We cover sorting a simple list, sorting inside a table with multiple columns, sorting with custom rules like month order or fiscal year, and using formulas when manual sorting is not enough.
The fastest method works for most clean datasets. The advanced methods exist because real-world data is messy. Pick the section that matches what you have in front of you, and skip ahead. Each method below has been tested on Excel 365, Excel 2021, and Excel for the web, so you can follow along regardless of which version your organization uses.
A quick note on terminology. Throughout this guide, we use the word range to mean any selection of cells, and table to mean a structured Excel Table (created with Ctrl+T). Tables and ranges sort similarly but behave differently with formulas, filters, and structured references. We will call out where this matters.
Four Ways to Sort by Date in Excel
Use Sort A to Z (oldest first) or Z to A (newest first) from the Data tab. Works for one isolated column or a properly structured list with headers.
Open the Sort dialog from Data > Sort. Add levels for primary, secondary, and tertiary sort keys. Example: sort by Year then Month then Customer.
Sort months by January through December instead of alphabetically. Create a custom list under File > Options > Advanced > Edit Custom Lists.
Excel Tables (Ctrl+T) include filter dropdown arrows. Click the arrow on any column header and choose Sort Oldest to Newest for a one-click chronological sort.
The four patterns above cover roughly 95 percent of date-sorting tasks. Below, we drill into each method with concrete steps so you can apply them immediately. We start with the absolute fastest approach, then layer in complexity as your data demands it.
If you are in a hurry, the Quick Sort tab below gets you to a sorted column in about five seconds. Bookmark this guide and come back when you hit a more complex scenario like fiscal year sorting or pivot tables.

Step-by-Step Sort Methods
Sort a Date Column in 3 Clicks
- Click any cell inside the date column you want to sort.
- Go to the Data tab on the ribbon.
- Click Sort Oldest to Newest (the icon with A above Z and a small calendar) or Sort Newest to Oldest.
Excel automatically expands the selection to include adjacent columns so your row data stays aligned. If a dialog asks whether to expand the selection, choose Continue with the current selection only if you want to sort the date column in isolation, which scrambles row relationships and is almost never what you want.
If the basic sort works, congratulations, you are done. But if you clicked Sort Oldest to Newest and the rows came back looking random, you almost certainly have text-formatted dates. This is the single most common Excel date problem, and the fix takes about 30 seconds once you know what to do.
Below, we cover the two most reliable methods for converting text to real dates. Pick the one that matches your data shape. If your column has clean uniform text like 01/15/2026 in every cell, Text to Columns is the fastest path. If your column has mixed garbage like January 15th, 2026 or 15-Jan-2026 mixed with 1/15/26, you will get further with the DATEVALUE function and some helper columns.
One trap to watch out for: regional settings. A file created in the UK with DMY date strings (15/03/2026 = March 15) will be misread on a US machine as MDY (15/03/2026 = invalid date, or worse, silently parsed as the wrong date). Always verify a handful of cells after any conversion to make sure month and day did not swap.
If your column has some cells formatted as 1/3/2026 and others as 03-Jan-26 or 2026-01-03, Excel may sort the real dates correctly and leave the text dates either at the top or bottom of the range. Always check the bottom 10 rows after sorting to make sure no stragglers got left behind. Mixed formats are especially common in data exported from accounting software, CRMs, and web scrapers. Standardize first, sort second.
Here is how to bulk-convert text dates into real dates so your sort works the first time. The fastest method uses the Text to Columns wizard, which is one of Excel's most underrated features. It was designed for splitting CSV data, but it doubles as a one-shot date converter.
Select the column with text dates, then go to Data > Text to Columns. Click Next twice to reach Step 3 of the wizard. Under Column data format, choose Date and pick the format that matches your input (MDY for U.S. style, DMY for European, YMD for ISO). Click Finish. Excel rewrites every cell as a real date in one pass. Now your sort will work as expected.
If the column also contains junk data that prevents Text to Columns from working, use the DATEVALUE function in a helper column instead. Type =DATEVALUE(A2) in B2 and drag the formula down. Cells that contain valid date strings will convert to serial numbers; cells with garbage will return a #VALUE! error, which is actually useful because it tells you exactly which rows need manual cleanup. Once the helper column is clean, copy it, paste as values back into the original column, and format as Date.

Pre-Sort Checklist
- ✓Confirm dates align right in their cells (text-formatted dates align left)
- ✓Check Format Cells (Ctrl+1) to verify the Date category is selected
- ✓Make sure there are no blank rows breaking up your data range
- ✓Convert any text dates using Text to Columns or DATEVALUE first
- ✓Back up your file or work on a copy before applying a destructive sort
- ✓If using a Table, verify all rows are inside the table boundary
- ✓Decide whether to include or exclude header rows in your selection
- ✓Choose ascending (oldest first) or descending (newest first) order
For datasets where the manual approach is too slow or error-prone, formulas give you a dynamic sort that updates automatically when source data changes. Excel 365 and Excel 2021 users have access to the SORT function, which is a game-changer. Older versions need a more manual approach using INDEX and MATCH with helper columns.
The SORT function syntax is straightforward: =SORT(array, [sort_index], [sort_order], [by_col]). To sort the range A2:C100 by the dates in column A in ascending order, you would type =SORT(A2:C100, 1, 1) in an empty cell. The result is a dynamic spilled array that updates automatically whenever the source changes. To sort newest first, change the third argument to -1.
If you only need to sort by date and keep one other column, SORT plus FILTER is a powerful combination. For example, =SORT(FILTER(A2:C100, B2:B100>1000), 1, -1) returns rows where column B is greater than 1000, sorted by column A newest first. This pattern is fantastic for live dashboards where the source data refreshes from an external query and you want the report view to stay current without ever clicking a sort button.
For Excel 2019 and earlier, the closest equivalent involves ranking each date with =RANK(A2,$A$2:$A$100) in a helper column, then using INDEX and MATCH to retrieve rows in rank order. It is clunky compared to SORT, but it gives you the same dynamic update behavior. If you have access to Excel 365 at all, upgrade your workbook to use SORT instead.
Excel SORT Function Pros and Cons
- +SORT function updates dynamically as source data changes
- +No need to repeatedly re-sort when rows are added or modified
- +Combines cleanly with FILTER, UNIQUE, and other dynamic array functions
- +Preserves the original data so you can sort multiple ways on the same sheet
- +Easy to chain with conditional logic for complex sorting rules
- −Only available in Excel 365 and Excel 2021, not in Excel 2019 or earlier
- −Spilled results can be overwritten if other cells get in the way
- −Cannot directly edit cells inside the spilled range (they are formula outputs)
- −Performance can lag on very large datasets (100,000+ rows)
- −Custom sort orders (like fiscal months) require the SORTBY function instead
One scenario that trips people up regularly is sorting dates inside a pivot table. Pivot tables have their own internal sort that operates differently from the regular range sort. To sort dates in a pivot table, click any cell in the date field, then go to PivotTable Analyze > Sort (or right-click the date field and choose Sort). Choose Sort Oldest to Newest or More Sort Options for additional control.
If your pivot table is grouping dates by month or year (a common automatic behavior), the sort works on those grouped buckets rather than individual dates. To sort by the actual underlying dates, first ungroup the field with PivotTable Analyze > Ungroup, then sort.
For pivot tables connected to Power Pivot or the data model, sort behavior follows the underlying data model's sort settings. You may need to set a Sort by Column property in Power Pivot to get the order you expect. This is particularly important when sorting by month name (you want January through December, not alphabetical), where you tell the model to sort the MonthName column by the MonthNumber column.
Another tricky case: sorting filtered ranges. If you apply a filter to hide certain rows and then sort the visible cells, Excel still sorts the entire range underneath, hidden rows included. To sort only the visible rows, copy them to a new location first, then sort. This is annoying, but the alternative would let sorts silently corrupt your data, so the strict behavior is probably correct.
Excel Questions and Answers
Sorting by date in Excel does not have to be frustrating. The vast majority of failed sorts come down to one root cause: dates stored as text instead of real serial values. Once you build the habit of checking cell alignment and using Format Cells to verify the data type, you will catch the problem before clicking Sort and save yourself the rework.
For day-to-day work, the ribbon's Sort Oldest to Newest button covers 90 percent of cases. For more complex needs, the Sort dialog with multiple levels handles secondary and tertiary keys, and Custom Lists give you fiscal year order, day-of-week order, or any other arbitrary sequence you need. Excel 365 users have the SORT function for dynamic sorting that updates automatically. And when something does go wrong, the Pre-Sort Checklist above is a fast 60-second diagnostic that catches almost every common mistake.
Practice these methods on real data until they become muscle memory. The next time someone hands you a 20,000-row export from QuickBooks or Salesforce with messy date columns, you will be the person who fixes it in under two minutes instead of giving up and exporting to a different tool. Mastery of date sorting is one of those small Excel skills that quietly separates competent users from power users, and now you have everything you need to make the leap.
If you want to push your Excel skills further, the practice tests linked above will reinforce what you have learned here through hands-on questions that simulate the kinds of dirty data you encounter in real work. Most learners who finish a focused 30-minute practice session retain these techniques far longer than they would from reading alone, because muscle memory beats theoretical knowledge every time when it comes to spreadsheet workflows.
One area where sorting by date intersects with broader Excel skill is data validation. Before you ever import a CSV into Excel, set up a column with data validation rules that force the date format you expect. Go to Data > Data Validation, choose Date from the Allow dropdown, and set a reasonable range like 1/1/2000 to 12/31/2030. Any cell that does not match a real date triggers a warning. This single setup step prevents about half the date sorting problems you would otherwise face later, and it takes about 20 seconds per column.
For teams sharing workbooks across regions, consider standardizing on the ISO 8601 format (YYYY-MM-DD) for all date entry. ISO dates sort correctly even as text strings, because the year comes first, then month, then day. They are unambiguous (no confusion between MDY and DMY), they are recognized by every database system, and they make text-stored dates a non-issue. Many large analytics teams adopt ISO-only date entry across their entire stack for exactly this reason.
If you regularly import data from external systems that send dates as text, build a one-time helper sheet with the Text to Columns conversion baked in as a recorded macro. Hit Alt+F8, run the macro, and your raw text dates become real Excel dates in one click. This is the kind of small automation that compounds across hundreds of imports per year. Total time investment: about 10 minutes to record. Total time saved: hours per quarter, easily.
One area where sorting by date intersects with broader Excel skill is data validation. Before you ever import a CSV into Excel, set up a column with data validation rules that force the date format you expect. Go to Data > Data Validation, choose Date from the Allow dropdown, and set a reasonable range like 1/1/2000 to 12/31/2030.
Any cell that does not match a real date triggers a warning, and you catch problems at the source rather than after they have spread across your workbook. For teams that share files across regions, standardize on ISO 8601 format (YYYY-MM-DD) for all date entry; ISO dates sort correctly even as text, are unambiguous worldwide, and integrate with every database system you might export to later.
About the Author
Attorney & Bar Exam Preparation Specialist
Yale Law SchoolJames R. Hargrove is a practicing attorney and legal educator with a Juris Doctor from Yale Law School and an LLM in Constitutional Law. With over a decade of experience coaching bar exam candidates across multiple jurisdictions, he specializes in MBE strategy, state-specific essay preparation, and multistate performance test techniques.