6 Ways to Get the Month Name from a Date in Google Sheets

This post is going to show you all the ways you can get the month name from a date in Google Sheets.

A date typically includes the day, month, and year information. But sometimes you may only require the month name such as January, February, March, etc.

In such a situation, if the dates you have in your data are in any of the traditional formats, you will have to find a way to extract the required information.

Fortunately, Google Sheets provides many different ways to get the month name with little to no trouble.

A date contains the day, month, and year information combined. These parts can be separated into individual components, making it possible for various types of manipulations to be carried out.

This article will show you how to use various methods to extract the month name from a date. Get your copy of the example workbook to follow along.

Convert To Month Name Using Custom Date and Time

While you can use the Custom date and time option to change the date format, you can also use it to extract individual components from a date.

This will format your dates wherever they come from.

This can be used to get the current month in a dynamic way by adding the current date and time value in your workbook.

To access the Custom date and time options, follow these steps.

  1. Select the cells containing the dates whose month you want to extract.
  2. Go to the Format menu.
  3. Click on Number from the options.
  4. Select the Custom date and time option from the submenu.

This will open the Custom date and time formats dialogue box. This is where you can create custom formats for dates and times.

  • Day is where you can specify how you want the day component of the date to appear.
  • Month is where you can specify how you want the month component of the date to appear.
  • Year is where you can specify how you want the year component of the date to appear.

You can access more options for formatting the individual date components by clicking on the arrow icons on the right side of each date component.

Everything in this dialogue box can be altered. You can even change the slash character / to a dash - or any other delimiter that you want.

The options you get when you click on the arrows give you plenty of choices that you can use to define how you want that particular component to appear.

As you can see from the image, you can even delete a component if you don’t want it to appear in your formatting.

This is how you can convert date to month name using the Custom date and time option.

  1. Delete all the other date components so that only the month component is remaining.
  2. To the right of the Month is a number in parenthesis. It indicates how the month format will be displayed. The number there shows that the month will be displayed as a number with leading zeros.
  3. Click on the arrows, then select either the Month as abbreviation or Month as full name options for the format.

If you select the option that displays the full name of the month, the value in the parenthesis will alter to reflect this choice.

  1. Click on the Apply button add the format.

Your dates will display as the month name, but the value in the cell is still the same date.

You can also follow this method to extract the day or year component from a date.

One benefit of using the Custom date and time format is it provides an option to display the name of the month, either in abbreviated form or in full.

You can also use this to extract the weekday name from a date.

The Custom date and time method aren’t dynamic. You have to redo the steps each time you add new date data to the existing dataset.

You can circumvent this by applying the format to the entire date column. This way, any new data you enter into the cells takes the applied format.

Convert Date to Month Name with the TEXT Function

The TEXT function is primarily used for formatting numbers into text in line with a defined format.

Since a date is a number, you can also use the TEXT function to extract individual components of a date.

Before you can begin to use the TEXT function for formatting dates, there are some date formatting codes that you should get familiar with.

CodeDescriptionResult
dExcludes leading zeros for days between 1-98
ddIncludes leading zeros for days between 1-908
dddReturns the abbreviated name of the dayMon
ddddReturns the full name of the dayMonday
mExcludes leading zeros for months within 1-94
mmExcludes leading zeros for months within 1-904
mmmReturns the abbreviated month nameApr
mmmmReturns the month name in fullApril
mmmmmReturns the first letter of the month nameA
y or yyDisplays the year component using two digits21
yyy or yyyyDisplays the year component using all four digits2021

The letters under the Code column in the table are the codes you’ll use to provide formatting instructions for the TEXT. The Result column shows the result of each Code when used in the TEXT function with the date 08/04/2021.

These can be used with any date value added to your spreadsheet.

= TEXT ( number, format )
  • number the number you want to which you want to apply the format. This can be a value, cell, or function.
  • format the string that specifies the format style you want to apply to the number value specified.
= TEXT ( A2, "mmmm" )

You can copy the above formula into an empty and it will return the month name based on the date in cell A2.

If you type the syntax into an empty cell, you will get a preview of the month name as you begin to type in the month code into the format argument. When you press enter, you can drag down the fill handle to populate the remaining cells.

Since the function is based on cell references, it is a more dynamic solution for handling new or additional data. This is a more preferable option to the Custom date and time method as a result.

Convert Date to Month Name with the QUERY Function

QUERY is a very powerful function in Google Sheets, so it’s no surprise it can be used to convert a date to the month name. The QUERY function allows you to use SQL-type code in the spreadsheet and this includes the format clause.

= QUERY ( data, query, [headers] )
  • data specifies the data that is to be queried.
  • query is used to specify what you want from the data. This argument is enclosed in double quotes.
  • header an optional argument that allows the use of numbers to specify how many rows contain headers in the data. If left blank, the function will use its best guess to identify the column headers in the data.

You can check out this post to learn more about the QUERY function.

= QUERY (A2:A13, "format A 'mmmm'" )

To use the QUERY function to extract the month name from a date, you can copy and paste the above formula into an empty cell and it will return the full month name from dates in the range A2:A13.

Convert Date to Month Name with the CHOOSE Function

Another function you can use to convert the month number to the month name is the CHOOSE function.

On its own, the CHOOSE function can’t extract the month name from the date. But when paired with the MONTH function, it can be used to get the month name.

With the CHOOSE function, you can enter a list of items and choose which one to return based on the item’s index number.

=CHOOSE(index, choice1, [choice2, …])
  • index this is the number of the item to return in the list of choices.
  • choice is a list of values to return.

You can enter a list of up to 30 choices into the choice section of the arguments. Each choice is indexed in ascending order which is seen in the choice1 and choice2 notations of the choice argument section.

If you want the function to return the first option of choices, the index argument will need to be 1.

If you want the function to return the 25th option from the choices, the index argument will need to be 25.

Whatever number is entered as the index must fall within the range of the number of choices listed in the choice section of the argument or the function will return an error.

Now, if you want to use the CHOOSE function to return the name of the month, you need to list all the names of the months as the choice section of the arguments. Then you can use the MONTH function to get the month number for the index argument.

= CHOOSE ( MONTH ( A2 ), "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" )

You can copy and paste the above formula to get the month name based on a date in cell A2.

The MONTH function returns a value between 1 and 12 depending on the date in A2. This results in an index argument that corresponds to the correct month name in the above formula.

Convert Date into Month Name Using an Apps Script

Another option to get the month name is to build your won custom function with Apps Scripts.

There is no dedicated function to return the month name based on a date, so why not create your own?

function MonthName(date) {
  var numMonth = date.getMonth();
  switch (numMonth) {
    case 0: return "January";
    case 1: return "February";
    case 2: return "March";
    case 3: return "April";
    case 4: return "May";
    case 5: return "June";
    case 6: return "July";
    case 7: return "August";
    case 8: return "September";
    case 9: return "October";
    case 10: return "November";
    case 11: return "December";
  };
};

Go to the Extensions tab and select Apps Script from the options to open the script editor. Copy and paste the above script into your script editor.

This script creates a custom function called MonthName and sets the argument as a date.

The function simply gets the month number and returns the corresponding name of the month. You can think of it as a modified MONTH function that returns the month name instead of the month number.

= MonthName ( A2 )

After you save the script. refresh your spreadsheet and you use your custom function.

Paste the above formula into your Google Sheets to return the month name from a date in cell A2.

Conclusions

Dates contain information about the day, month, and year. But it is possible to extract only the month from any date.

It is also possible to convert the month into the month name using a format, functions, or Apps Scripts.

These methods for extracting the month name from the date can be applied in many situations. Which to use will depend on the situation.

Do you use any of these methods to get the month name from a date in Google Sheets? Do you know any other ways to do this? Let me know in the comments section below!

About the Author

Oluwaseun Olatoye

Oluwaseun Olatoye

Oluwaseun is a business intelligence analyst with expertise in Google Sheets and SQL programming language. He has worked with various businesses to make data-driven decisions. He enjoys helping others learn and grow.

Related Articles

Comments

0 Comments

Get the Latest Google Sheets Tips

Write For Us

Are you a tech enthusiast with a talent for writing great content? Come write for us!

Follow Us

Follow us on social media to stay up to date with the latest in Google Sheets!