Convert Between Month Name & Number in Google Sheets


You can use the following formulas to convert between month names and numbers in Google Sheets:

Method 1: Convert Month Number to Month Name

#convert month number in cell A1 to full month name
=TEXT(A1*29, "mmmm")

#convert month number in cell A1 to abbreviated month name
=TEXT(A1*29, "mmm")

Method 2: Convert Month Name to Month Number

#convert month name in cell A1 to month number
=MONTH(A1&1)

The following examples show how to use these formulas in practice.

Example 1: Convert Month Number to Month Name in Google Sheets

The following screenshot shows how to use the TEXT() function to convert month numbers (from 1 to 12) to month names (from January to December):

convert month number to month name in Google Sheets

Note that we can also use the “mmm” format to convert the month number to the abbreviated month name:

convert month number to abbreviated month name in Google Sheets

Example 2: Convert Month Name to Month Number in Google Sheets

The following screenshot shows how to use the MONTH() function to convert month names (from January to December) to month numbers (from 1 to 12):

convert month name to month number in Google Sheets

Note that this function will work on abbreviated month names as well:

Additional Resources

How to Extract Substring in Google Sheets
How to Combine Columns in Google Sheets
How to Count Number of Occurrences in Google Sheets

2 Replies to “Convert Between Month Name & Number in Google Sheets”

  1. When converting the month number to full month, the formula below works. But can you please explain why we multiply by 29?

    #convert month number in cell A1 to full month name
    =TEXT(A1*29, “mmmm”)

    1. the function TEXT(number, format) converts the number into various text formats. The “mmmm” text format is programmed to output the month representation of the number given.

      The reason we multiply the month number (1-12) by 29 is to get the DATE that falls into that month without fail. If our month number is 1: multiplying A1 by any number between 1 and 31 will yield a result between 1 and 31. All of those numbers when passed into TEXT will become January because the month of January is understood to contain the first 31 dates.

      Similarly, days 32 through 59 are February, 60 through 90 are March, so on and so forth. You can do TEXT(32, “mmmm”) or TEXT(35, “mmmm”) and they both (as well as all the other 26 values) will yield February as the output text.

      So A1 * 29 is just a shorthand to quickly generate a date that falls into the month represented in A1 because 31 days a month is too many and will fail to generate some months, 29 is just short of 30 so each each the date will fall behind by 1 or 2 days, but because we only have 12 months in a year, the “gap” only ever grows to 2 weeks at most: 365 – 12*29 = 17 (days). So 12*29 = 348th day which is Dec 13 instead of Dec 31. In full, the dates we generate via A1 * 29 are:

      January-28
      February-26
      March-27
      April-25
      May-24
      June-22
      July-21
      August-19
      September-17
      October-16
      November-14
      December-13

Leave a Reply

Your email address will not be published. Required fields are marked *