Sorting Month Names Chronologically in Excel Using the DATEVALUE Function

📅 Feb 12, 2026 📝 Sarah Miller

Sorting text-based month names in Excel often results in frustrating alphabetical ordering rather than chronological flow. While users typically rely on rigid custom lists or manual adjustments to bypass this, these standard methods lack dynamic flexibility. Utilizing the DATEVALUE function grants an elegant, automated solution by converting text into sequential serial numbers for flawless sorting. For successful execution, Excel stipulates that the text must represent a recognizable date; for example, appending a day to the month, such as =DATEVALUE(A2&" 1"), converts "January" into a sortable numeric value. Below, we outline the exact formula steps to streamline your dataset.

Sorting Month Names Chronologically in Excel Using the DATEVALUE Function

When working with financial reports, sales pipelines, or monthly summaries in Excel, you often find yourself dealing with lists of month names. While text-based month names like "January," "February," and "March" are highly readable for humans, they present a notorious challenge when you try to sort them in Microsoft Excel.

By default, if you attempt to sort a column of month names, Excel treats them as standard text strings. The result? Your chronological calendar is sorted alphabetically: April, August, December, February, January, and so on. This ruins the chronological flow of your reports.

While Excel offers built-in Custom Lists to solve this, they can be clunky, aren't always portable across different workbooks, and don't work dynamically inside formulas. Fortunately, there is an elegant, formula-based solution using the DATEVALUE function. In this comprehensive guide, we will explore how to use the DATEVALUE function to sort month names chronologically, both in legacy Excel setups and using dynamic arrays in modern Excel (Office 365).

The Root of the Problem: Why Excel Sorts Months Alphabetically

Excel is highly efficient at sorting dates because, under the hood, it stores dates as sequential serial numbers. For example, January 1, 1900, is stored as serial number 1, and January 1, 2026, is stored as 46023. When you sort actual dates, Excel simply sorts these underlying numbers.

However, when your cells contain plain text strings like "January" or "Feb", Excel has no native understanding that "February" should follow "January". It sees them as raw text and applies alphabetical sorting rules. To fix this, we need a way to temporarily convert those text strings into date serial numbers or month index numbers (1 through 12). This is where the DATEVALUE function shines.

Understanding the DATEVALUE Function

The DATEVALUE function is designed to convert a date that is stored as text into a serial number that Excel recognizes as a date. The syntax is straightforward:

=DATEVALUE(date_text)

The key to using this function with raw month names is that DATEVALUE requires a complete date structure (day, month, and year) to work correctly. If you pass just "January" to the function, it will return a #VALUE! error. To make it work, we must append a day and a year to the text using concatenation.

The Concatenation Trick

By appending a day (such as "1") to our month text, we construct a recognizable date string. For example:

=DATEVALUE(A2 & " 1")

If cell A2 contains "January", the formula evaluates A2 & " 1" as "January 1". Excel automatically assumes the current calendar year and converts "January 1, [Current Year]" into its respective date serial number. Once you have this serial number, you can easily sort your data chronologically.

Method 1: The Helper Column Approach (Works on All Excel Versions)

If you are using older versions of Excel (such as Excel 2013, 2016, or 2019), the most robust approach is to create a helper column. This column converts the month names into sortable date values.

Step-by-Step Instructions:

  1. Insert a Helper Column: Right-click the column next to your month names and select Insert. Label this new column "Sort Value" or "Date".
  2. Enter the Formula: Assuming your first month name is in cell A2, enter the following formula in your helper column (cell B2):
    =DATEVALUE(A2 & " 1")
    Note: This formula works perfectly for both full month names ("January") and three-letter abbreviations ("Jan").
  3. Drag the Formula Down: Copy the formula down to the rest of the cells in the helper column. You will see large numbers (e.g., 45292). These are Excel's date serial numbers.
  4. Sort the Data:
    • Select any cell within your helper column.
    • Go to the Data tab on the Ribbon.
    • Click the Sort A to Z (Smallest to Largest) button.

Your entire table will now automatically sort chronologically from January to December. If desired, you can hide the helper column to keep your sheet clean.

Method 2: Sorting by Month Number (1 to 12)

While sorting by serial numbers works perfectly, some users prefer to see a clean month index (1 for January, 2 for February, etc.) in their helper columns. You can easily achieve this by nesting your DATEVALUE formula inside the MONTH function.

The MONTH function extracts a number from 1 to 12 from any valid Excel date. Use this formula in your helper column:

=MONTH(DATEVALUE(A2 & " 1"))

Why this method is advantageous:

  • Year-Independent: Unlike the raw DATEVALUE function, which relies on the current calendar year, the MONTH function always returns a clean integer from 1 to 12. This ensures your sorting logic remains unchanged regardless of what year the system clock is set to.
  • Simplicity: It is easier to troubleshoot integers like 1, 2, and 3 than five-digit serial numbers.

Method 3: Dynamic Sorting with SORTBY (Excel 365 & Excel Online)

If you are using modern Excel (Microsoft 365 or Excel for the Web), you don't need helper columns at all. You can use dynamic array formulas to sort your month list automatically and dynamically.

The SORTBY function allows you to sort an array based on the values in a corresponding array. Here is how to write the formula:

=SORTBY(A2:B13, MONTH(DATEVALUE(A2:A13 & " 1")))

How this formula works:

  • A2:B13: This is the range of data you want to sort (e.g., Month Names in column A and Sales Data in column B).
  • A2:A13 & " 1": This creates an in-memory array of date strings ("January 1", "February 1", etc.).
  • DATEVALUE(...): Converts those text strings into date serial numbers on the fly.
  • MONTH(...): Converts the serial numbers into an array of integers (1 through 12).
  • SORTBY(...): Takes your original data and sorts it based on the array of month numbers generated behind the scenes.

This method is highly dynamic. If you change a month name in your source table, the sorted list will automatically recalculate and reorder itself instantly without manual sorting steps.

Troubleshooting Common Errors

While using DATEVALUE to sort month names is incredibly useful, you may run into a few common pitfalls. Here is how to diagnose and fix them:

1. The #VALUE! Error

If your formula returns a #VALUE! error, it means Excel cannot interpret the text string as a date. This is usually caused by:

  • Leading or Trailing Spaces: If your cell contains "January " (with a trailing space), DATEVALUE("January 1") will fail. Fix this by wrapping your cell reference in the TRIM function:
    =DATEVALUE(TRIM(A2) & " 1")
  • Spelling Mistakes: Double-check for typos like "Febuary" instead of "February".
  • Regional Settings: If your Excel is configured for a non-English locale (such as German or Spanish), Excel will not recognize "January". You must use the month names corresponding to your computer's regional settings (e.g., "Januar" for German).

2. Handling Non-Standard or Mixed Inputs

If your dataset contains blank rows or non-date text, the formula will break. To prevent this, you can wrap your calculation inside an IFERROR or IF statement to keep your spreadsheet clean:

=IF(A2="", "", MONTH(DATEVALUE(A2 & " 1")))

Summary of Methods

To help you choose the best approach for your specific project, here is a quick comparison table of the methods discussed:

Method Formula Excel Compatibility Pros / Cons
Raw DATEVALUE Helper =DATEVALUE(A2 & " 1") All Versions Simple, but displays confusing five-digit date serial numbers.
MONTH + DATEVALUE Helper =MONTH(DATEVALUE(A2 & " 1")) All Versions Produces clean month index numbers (1-12) which are easy to read and sort.
Dynamic SORTBY Array =SORTBY(A2:B13, MONTH(DATEVALUE(A2:A13 & " 1"))) Office 365 / Web No helper columns needed; updates dynamically. Doesn't work on older Excel versions.

Conclusion

Sorting month names chronologically in Excel doesn't have to be a manual headache. By leveraging the DATEVALUE function, you can quickly convert text strings into actionable chronological data. Whether you choose to use a classic helper column with MONTH(DATEVALUE()) or implement a cutting-edge dynamic array solution using SORTBY, these formulas will save you time and keep your professional spreadsheets accurate, dynamic, and perfectly ordered.

Disclaimer:
The documents and templates provided on this page are for informational and illustrative purposes only. They do not constitute professional, legal, or financial advice, and should not be relied upon as such. Because individual circumstances and regulatory requirements vary, these materials may not be suitable for your specific needs. We recommend consulting with a qualified professional before adapting or using any of these examples for official or commercial purposes.