Excel Practice Test

โ–ถ

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

3 clicks
Fastest sort method
64 levels
Max custom sort levels
1900-01-01
Excel's date origin
100%
Accuracy with real dates

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

๐Ÿ”ด Single Column Sort

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.

๐ŸŸ  Multi-Column Sort

Open the Sort dialog from Data > Sort. Add levels for primary, secondary, and tertiary sort keys. Example: sort by Year then Month then Customer.

๐ŸŸก Custom List Sort

Sort months by January through December instead of alphabetically. Create a custom list under File > Options > Advanced > Edit Custom Lists.

๐ŸŸข Table Sort

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

๐Ÿ“‹ Quick Sort

Sort a Date Column in 3 Clicks

  1. Click any cell inside the date column you want to sort.
  2. Go to the Data tab on the ribbon.
  3. 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.

๐Ÿ“‹ Dialog Sort

Multi-Level Sort with the Sort Dialog

  1. Select any cell in your data range.
  2. Click Data > Sort to open the Sort dialog.
  3. Under Sort by, choose your date column from the dropdown.
  4. Set Sort On to Cell Values.
  5. Set Order to Oldest to Newest or Newest to Oldest.
  6. Click Add Level to add secondary sort keys (e.g., sort by Date then by Amount descending).
  7. Click OK.

You can add up to 64 sort levels, although in practice anything beyond three or four becomes hard to reason about.

๐Ÿ“‹ Table Filter

Sort Inside an Excel Table

If your data is formatted as a table (press Ctrl+T on any range to convert), every column header has a dropdown arrow:

  1. Click the arrow on the date column header.
  2. Choose Sort Oldest to Newest or Sort Newest to Oldest.
  3. The arrow icon updates to show the active sort direction.

Tables are the most forgiving way to sort because Excel always treats the table as a single unit. You will never accidentally sort one column while leaving others behind, which is the biggest source of data corruption when sorting plain ranges.

๐Ÿ“‹ Custom Order

Sort by Month Name or Fiscal Year

  1. Open File > Options > Advanced.
  2. Scroll to the General section and click Edit Custom Lists.
  3. Type your custom order, one item per line (e.g., Jul, Aug, Sep, Oct, Nov, Dec, Jan, Feb, Mar, Apr, May, Jun for a July-start fiscal year).
  4. Click Add, then OK.
  5. In the Sort dialog, set Order to Custom List and pick the one you just created.

Custom Lists are stored per-installation, not per-workbook, so you only have to create your fiscal year list once and it will be available in every file you open.

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.

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
Try Excel Sort Practice Questions

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

Pros

  • 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

Cons

  • 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

Why are my Excel dates not sorting correctly?

The most common reason is that your dates are stored as text instead of real date values. Text dates align left in cells and sort alphabetically (so 10/1/2026 comes before 2/1/2026). Convert text to dates using Data > Text to Columns, choose Date format, and select the correct date order (MDY, DMY, or YMD). After conversion, your sort will work correctly.

How do I sort by date and time together in Excel?

If your timestamps are in a single cell as datetime values (like 2026-01-15 14:30), Excel sorts them correctly with a standard date sort because both date and time are part of the same serial number. If date and time are in separate columns, use a multi-level sort: Data > Sort, set the primary sort to the date column and add a second level for the time column.

Can I sort by month ignoring the year?

Yes. Create a helper column with the formula =MONTH(A2) to extract just the month number, then sort by that helper column. To sort by month name in calendar order rather than alphabetically, use =TEXT(A2,"mmmm") in the helper column and apply a Custom List sort with January through December as the order.

How do I sort by date in an Excel Table?

Click the dropdown arrow on the date column header in your table and select Sort Oldest to Newest or Sort Newest to Oldest. The arrow icon will change to show the active sort. Tables are the most reliable way to sort because Excel always keeps row data aligned together, so you never accidentally orphan rows.

Why does sorting move my header row?

If your headers got sorted into the data, Excel did not recognize them. Before sorting, make sure your headers are clearly different from the data (formatted bold, frozen pane, or in a Table). In the Sort dialog, check the My data has headers box. For one-off fixes, undo with Ctrl+Z and try again with the box checked.

How do I keep rows together when sorting by date?

Select the entire range including all columns, not just the date column. When Excel asks whether to expand the selection, choose Expand the selection. If you select only the date column and choose Continue with the current selection, the dates get sorted but other columns stay in place, which scrambles your data. Using an Excel Table prevents this problem entirely.

Can Excel sort dates in custom fiscal year order?

Yes, by creating a Custom List. Go to File > Options > Advanced > Edit Custom Lists, then add your fiscal months in the right order (for example: Jul, Aug, Sep, Oct, Nov, Dec, Jan, Feb, Mar, Apr, May, Jun). In the Sort dialog, change Order to Custom List and select your fiscal list. This sorts by month name in fiscal order regardless of year.

How do I sort by date using a formula?

In Excel 365 and Excel 2021, use the SORT function: =SORT(A2:C100, 1, 1) sorts the range A2:C100 by the first column in ascending order. Change the third argument to -1 for newest first. For older Excel versions, you need to use INDEX, MATCH, and SMALL or RANK in a more complex array formula, or just stick with the manual ribbon sort.
Take the Excel Practice Test

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.

โ–ถ Start Quiz