Extract Month Name in Google Sheets – How To Convert Month Number to a Month Name in Google Sheets?

Extract Month Name in Google Sheets: When working with the dataset with date values, it would be quite confusing to know the exact month. In particular, if you are working on sales data and want to know in which month the sales were high, then extracting the month from the date would help to find the answer to this. Thus, to get the month from the dates, we can simply use the custom date and time format to get the month name. Apart from the custom date and time format method, there are several methods with the help of which we can extract the month name in Google Sheets. And to help you with this here is a page that contains methods on how to extract the Month name using the Google Sheets Tips. Read further to find more.

Also Read: How to find the smallest number in an array java

Table of Contents

Extract Month Name in Google Sheets Based on Date

As discussed above, extracting the month name from the provided date can be done using the Custom date and time format feature. The detailed steps on how to do this in Google Sheets are highlighted below:

  • 1st Step: Open the Google Spreadsheet on your device.
  • 2nd Step: Now on the homepage, click on the “Format” tab and choose “Number” from the drop-down menu.
  • 3rd Step: Choose “Custom date and time” from the sub-dropdown menu.

extract-month-names

  • 4th Step: In the Custom date and time formats window, click on the “Month” option.
  • 5th Step: Select “Month as Full Name (August)” from the options available.

extract-month-names

  • 6th Step: Click on the “Apply” button and you will see the month name is displayed instead of the dates.

extract-month-names

One of the main drawbacks of this method is that we will lose the dates and only the month name will be displayed. So if you want to keep the dates and extract the month in a separate cell, then you can make use of other methods that are explained in the below section.

extract-month-names

Extract Month Name in Google Sheets Formula

With the help of various functions, we can create formulas in Google Sheets to extract the month name from the given date. To help you save your time, here is a table with a list of functions and their formulas to get the month name from the dates.

Function Name Google Sheets Extract Month Formula 
TEXT Function = TEXT (A1, “mmmm”)
QUERY Function = QUERY (A1:A12, “format A’mmmm'”)
CHOOSE Function = CHOOSE (MONTH (A2)”, “January”, “February”, “March”, “May”, “June”, “July”, “August”, “September”, “October”, “November”, “December”).

Based on your cell range, you can change the cell number here. A detailed explanation of how to use these functions and formulas in Google Sheets is explained below.

Using the TEXT Function to Get the Month Name from the Date in Google Sheets

Follow the steps highlighted below use TEXT Function to get the month name from the provided date in the Google Spreadsheet:

  • 1st Step: Open the Google Spreadsheet on your device.
  • 2nd Step: Now on the homepage, move to the cell where you want to extract the month name from the dates.
  • 3rd Step: Enter the formula “= TEXT (A1, “mmmm”)“. Here, A1 is the cell number. You can tweak the formula by replacing your cell number.
  • 4th Step: Press the “Return” key and you will find the results as shown in the image given below.

extract-month-names

 

Using the QUERY Function To Extract the Month Name From the Date in Google Sheets

One can also extract the month name from the given dates by using the QUERY function. The detailed steps on how to get this done in the spreadsheet are given below:

  • 1st Step: First, launch Google Sheets on your device.
  • 2nd Step: On the homepage, move to the cell where you want to get the month name from the provided dates.
  • 3rd Step: Now enter the formula “= QUERY (A1:A12, “format A’mmmm'”)“. Here the cell range is A1 to A12. Based on your cell range, you can customize the formula.
  • 4th Step: Press the “Return” key and you will find the results as shown in the image given below.

extract-month-names

 

Using the CHOOSE Function To Extract the Month Name From the Date in Google Sheets

The steps to extract the month name from the dates using the CHOOSE function in Google Sheets are given below:

  • 1st Step: Launch Google Sheets on your device.
  • 2nd Step: Now on the homepage, move to the cell where you want to extract the month name.
  • 3rd Step: Here, enter the formula “= CHOOSE (MONTH (A2)”, “January”, “February”, “March”, “May”, “June”, “July”, “August”, “September”, “October”, “November”, “December”).
  • 4th Step: Press the “Enter” key and you will see the results as shown in the image given below.

extract-month-names

Using Apps Script To Extract Month Name in Google Sheets

The Apps Script is one of the most useful features in Google Sheets that help you perform various operations on the spreadsheet. The detailed steps on how to use the Apps Script to extract the month name from the spreadsheet are given below:

  • 1st Step: Open the Google Spreadsheet on your device.
  • 2nd Step: Now on the homepage, click on the Extensions and choose “Apps Script” from the drop down menu.
  • 3rd Step: Here we are creating a function “MonthName” and assigning each month a case and what to return for every case using the getMonth function. You can simply copy and paste the following code into Apps Script and run the program.
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”;

};

};

extract-month-names

  • 4th Step: Once the program is executed successfully, come to the spreadsheet and enter the following formula: “= MonthName (A2).
  • 5th Step: Press the “Return” key and you will find the results as shown in the image given below.
  • 6th Step: Now drag the formula applied cell to other parts of the cell to extract the month name from all the cells.

extract-month-names

You now know how to get the month name from the dates using various approaches. These methods for obtaining the month name from the date can be used in a number of situations. Which one to use will be determined by the situation.

However, if you know of any other ways of extracting the month name from a date, please share them in the comments section below to assist other readers.

Leave a Comment