Formula for Sorting by Month Name in Google Sheets

Published on

Sorting by month name might be familiar to Excel users, as Excel offers a custom sort option. However, Google Sheets handles this differently. To sort by month name in Google Sheets, you need to use a custom formula.

I have a list in Google Sheets with a column of month names in text format. Unfortunately, this column does not sort in chronological order. When I apply Data > Sort range after selecting it, the months are arranged in alphabetical order.

You can sort month names in chronological order in Google Sheets using either the SORT or SORTN function. In this tutorial, I will demonstrate how to use the SORT function to achieve this.

By default, the SORT menu or formula in Google Sheets allows you to sort your list in ascending (A-Z) or descending (Z-A) order.

Let me show you how to adjust the SORT function to sort a column containing month names in text format chronologically.

Examples of Sorting by Month Name in Google Sheets

If the month names are in column A within the range A2:A13, you can use the following formula in cell B2 to sort them in chronological order:

=SORT(A2:A13, MONTH(A2:A13&1), 1)

How does this formula sort month names in chronological order?

When you append the number 1 to a month name (e.g., “January1”), it is interpreted as a date (e.g., 01/01/2024), where the year defaults to the current year.

In this formula, we append 1 to the month names to convert them into the first day of each month in the current year.

The MONTH function, one of the date functions, then extracts the month numbers from these dates.

The role of the MONTH function in sorting month names

Although ARRAYFORMULA is typically required for operations involving arrays, it is not necessary here because the SORT function itself operates as an array formula.

The SORT function then sorts the month names in chronological order based on the month numbers.

Here’s the generic version of the formula to sort month names in Google Sheets:

SORT(range, sort_column, is_ascending)

In this case:

  • range: A2:A13
  • sort_column: MONTH(A2:A13&1)
  • is_ascending: 1 (for ascending order) or 0 (for descending order)

If you want to sort data in a range such as A2:C13, where month names are in column A, use the following formula:

=SORT(A2:C13, MONTH(A2:A13&1), 1)
Example of sorting month names in chronological order

Resources

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

How to Extract Numbers from Text in Excel with Regex

You can use the REGEXEXTRACT or REGEXREPLACE functions to easily extract numbers from text...

Using OFFSET and MATCH Together in Google Sheets: Advanced Tips

One powerful and flexible way to look up values is by combining the OFFSET...

How to Use OFFSET and XMATCH Functions Together in Excel

We often use the OFFSET and XMATCH functions together to match a value in...

How to Calculate Maximum Drawdown in Excel and Google Sheets

You can use the following dynamic array formula to calculate maximum drawdown (MDD) in...

More like this

Using OFFSET and MATCH Together in Google Sheets: Advanced Tips

One powerful and flexible way to look up values is by combining the OFFSET...

Running Count with Structured References in Google Sheets

Running a count with structured references is achievable in Google Sheets tables using the...

Running Total with Structured Table References in Google Sheets

You can use two types of formulas to create a running total with structured...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.