To sort an Excel spreadsheet by date, click a date cell and choose Data > Sort Oldest to Newest or Data > Sort Newest to Oldest in Excel for Microsoft 365 on Windows. If the worksheet has other columns of information, make sure Excel sorts the entire table or range so each date stays with its original row.
Quick steps to sort dates
For a simple list with a header row, use these steps:
- Click one cell in the date column. Do not select just the date cells if the same rows contain names, amounts, or other details.
- Open the Data tab.
- In the Sort & Filter group, choose Sort Oldest to Newest for ascending order, or Sort Newest to Oldest for descending order.
- If Excel asks whether to expand the selection, choose Expand the selection, then click Sort.
For example, an ascending sort puts January 5, 2024 before February 12, 2024, and both before January 5, 2025. A descending sort reverses that sequence. The date display format does not have to change: a cell displayed as 5-Jan-2024 can sort alongside one displayed as 01/05/2024 if both contain real Excel dates.
In Excel for Mac, the same basic commands are on the Data tab, although ribbon layout can vary with the window size and version. Excel for the web also offers date sorting from the Data tab and, in many worksheets, from a column’s filter menu. Check that the resulting order is chronological and that related columns moved with the dates.
How Excel understands dates
Excel does not usually sort a real date by comparing the characters you see on screen. It stores dates as serial numbers, with time represented as a fractional part of a day. The number format controls how a value appears; it does not determine whether the value is a date. That is why a genuine date can be displayed in several ways and still sort correctly.
Text that looks like a date is different. For example, a cell may contain the characters 10/2/2024 rather than an Excel date value. Text can sort alphabetically or lexicographically, which may produce an order that looks wrong: a text value beginning with 1 can come before one beginning with 2 even when the dates are not in chronological order. Changing the cell format to Date alone does not necessarily convert text into a date.
A quick clue is to select a cell and temporarily choose a different date format from Home > Number Format. If the appearance changes while the value remains a date, Excel is likely recognizing it as a date. If formatting has no effect, or if the sort remains strange, the values may be stored as text. Alignment can offer a clue, too, but it is not a definitive test because cells can be manually aligned.
Sort a complete table without separating rows
A spreadsheet row usually represents one record: a date plus the person, product, amount, or note associated with it. Sorting only the date column can detach the dates from those details. In a normal range, Excel often warns that adjacent data exists and asks whether to expand the selection. Choose Expand the selection so every column in each record moves together. Choosing Continue with the current selection sorts only the selected cells and can scramble the data.
Before sorting, confirm that the data forms one continuous rectangle, with a single header row and no unrelated values immediately beside it. Click a cell inside the range rather than highlighting only one column. If Excel selects the wrong area, undo immediately with Ctrl+Z on Windows or Command+Z on Mac, then select the intended full range and try again.
For regularly maintained data, consider converting the range to an Excel table with Insert > Table and confirming whether the table has headers. Table headers have filter buttons, and sorting from a date column’s button keeps each record together. Tables also expand more naturally as rows are added. If the worksheet already has a table, use the date header’s drop-down and choose the oldest-to-newest or newest-to-oldest option.
Use the Sort dialog for more control
The quick buttons are convenient when the date is the only sorting rule. For a specific range, a header choice, or multiple sorting levels, click inside the data and select Data > Sort. In the dialog, confirm that My data has headers is selected when the first row contains labels. Under Column, choose the date field; set Sort On to Cell Values; then choose Oldest to Newest or Newest to Oldest under Order.
Multiple levels help when dates repeat. For instance, you can sort first by date from oldest to newest and then add a level for customer name from A to Z. In the Sort dialog, choose Add Level to add the second rule. Excel applies the date rule first, then orders records with matching dates according to the next level. If the date cells also contain times, different times on the same day are distinct values and can sort within that day.
Use the dialog rather than a single-column shortcut if your data has several adjacent fields, a deliberate header row, or more than one sorting condition. Review the selected range and column names before clicking OK, especially if the sheet includes blank rows or columns that might make Excel detect a smaller range than intended.
Convert text dates before sorting
If sorting produces an unexpected order, first determine whether the date values are real dates or text. A common repair for a column of consistently formatted text dates is Data > Text to Columns. Select the date cells, start the wizard, choose Delimited, and click Next twice. On the final step, under Column data format, choose Date and the order that matches the source, such as MDY, DMY, or YMD, then click Finish. Check a few converted cells before sorting the full list.
For example, 04/07/2024 can mean April 7 or July 4, depending on the date convention used by the source. Choosing the wrong order may convert the text into a valid but incorrect date, so do not guess based only on how the values look. Confirm the source system’s convention, and pay particular attention to dates where both the first and second numbers are 12 or less, because those values are ambiguous.
Text to Columns changes the selected cells, so preserve the original data if it may need to be restored. You can copy the column first or test the conversion on a few sample cells. If the source contains mixed formats, blanks, or invalid dates, inspect and standardize those entries individually rather than assuming one conversion setting will correctly interpret every row.
Regional settings and imported date formats
Date interpretation can depend on regional settings and on the format used by the system that created the file. A date imported from a system using day-month-year notation may be misread on a computer expecting month-day-year notation. Dates in the ISO-style year-month-day form are less ambiguous to a human reader, but an imported column can still be text rather than date values.
When importing a file, use the import preview and any available data-type or locale controls to check how the date column is interpreted. After loading it, sort a small test range and inspect dates with unambiguous days, such as one greater than 12. If a date is converted incorrectly, correct the interpretation before relying on the sorted result. Sorting can arrange values consistently while still preserving an earlier conversion mistake.
Dates with times, blanks, and unusual entries
Excel sorts date-and-time values by their complete stored value, not just the date displayed. If cells show only the day but contain different times, they may appear to tie even though Excel orders them by time. To reveal the difference, apply a date-and-time format temporarily. If you want all entries grouped by calendar day, decide whether times should be retained, removed, or used as a secondary sort criterion before changing the data.
Blank dates usually gather at the end of a sorted list, while text labels or errors in the same column can make the order less intuitive. Keep a date column limited to dates and blanks where possible. If a date is unknown, avoid entering a made-up date merely to force a position; use a clear status field or another documented method to distinguish missing information. After sorting, scan the top and bottom of the range for blanks and unusual values.
Sorting versus filtering or rearranging data
Sorting changes the order of records; filtering hides records that do not meet chosen conditions without changing the underlying order of the remaining records. If the goal is to see only dates in a particular month, use a filter rather than repeatedly rearranging the dataset. For a table, open the date header’s filter menu and select a date range or an appropriate date filter. Clear the filter to show all rows again.
Sorting is also different from copying a list into a new order. A normal sort changes the displayed row order in the selected range. If you need to preserve an original sequence, duplicate the data first or add a separate sequence field before sorting. This is useful for audit trails, imported records, or workflows where the original order has meaning.
Frequently Asked Questions
How do I sort an Excel spreadsheet by date from oldest to newest?
Click a date cell and choose Data > Sort Oldest to Newest. If Excel asks, expand the selection so the rest of each row stays with its date.
Why does Excel sort my dates alphabetically?
The cells may contain text rather than date values, or the column may mix text and real dates. Convert consistently formatted text dates with Data > Text to Columns, selecting the correct date order, then sort again.
How can I sort dates and keep the other columns together?
Click within the dataset and sort the date field, not an isolated selection of date cells. When prompted, choose Expand the selection. Sorting from a table’s date-header menu also keeps records intact.
Can I sort by date and then by another column?
Yes. Choose Data > Sort, set the date as the first level, and use Add Level to specify a second field, such as a name or category.
Why are dates like 04/07/2024 confusing?
The value can represent April 7 or July 4, depending on the source’s regional convention. Confirm whether the source uses MDY or DMY before converting or sorting ambiguous text dates.
Related
- Excel Sum Above: How to Add Cells Above Your Total
- Excel Max Rows per Sheet: Limits and Workarounds
- Excel Max Value in a Column: Find the Largest Number
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- Excel IF Formula Examples for Everyday Spreadsheet TasksExcel’s IF formula checks whether a condition is true and returns one result if it is, and another…
- Excel Formula to Calculate Days Between Dates, ExplainedTo calculate elapsed days between two dates in Excel, subtract the earlier date from the later one. With…
- Excel Autofill vs Flash Fill: How to Choose the Right ToolExcel AutoFill extends a series or copies cell contents, while Flash Fill recognizes a pattern in your examples…
- Excel CONCATENATE Formula Examples and UsesIn Excel, join text with =CONCAT(A2," ",B2) or the ampersand operator, as in =A2&" "&B2; if A2 contains…
- Excel Trim a Table: Clean Text or Remove Rows?To trim text inside an Excel table, add a column with =TRIM([@[Raw Name]]); to trim the table’s physical…
- Capitalize Each Word in Excel with the PROPER FormulaTo capitalize the first letter of each word in Excel, enter =PROPER(A2) in an empty column beside the…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.