Google Sheets comes with powerful functions to organize and analyze dates. You can use functions like MONTH and TEXT to get month from date in Google Sheets.
Sometimes, the given date needs to be split into the day, month, and year for analyzing the datasets and preparing specific reports.
There are various functions in Google Sheets to execute this task.
Months are crucial, as we often have to perform calculations based on them to prepare specific reports demonstrating task progress, deadlines, or order counts.
So, if you want to extract the month from a given date, you have come to the right place.
In this article, let us understand and learn how to get the month from a date using Google Sheet functions. It will be a quick guide with plenty of useful instructions that may help you in the future, so make sure to read the article till the end.
We will discuss the following methods to extract the date.
- Get a month from the given date using the MONTH function
- Get a month from the given date using the TEXT function
Both methods are straightforward, and you don’t need expert knowledge to master them.
Copy the Example Google Sheet
Consider downloading or copying the following Google Sheet to practice the functions and methods we are about to discuss in the following sections.
It contains the spreadsheets with the datasets used to demonstrate the MONTH and TEXT functions in this article.
If your Google Sheet is ready with date data, you can skip downloading the above file.
Explained: MONTH function in Google Sheets
The MONTH is a simple function in Google Sheets. The general syntax for this formula is as follows,
=MONTH(date)
The argument “date” is pretty obvious here; you can either manually type the date or select the cell reference value holding the date as a text string or serial number.
How to Get Month from Date in Google Sheets using the MONTH function
The MONTH function returns an integer number that represents the respective month.
Simply put, the MONTH function will return 1 for January, 2 for February, 3 for March, and so on.
Though these integer values are useful in a few cases, you may be particularly interested in month names. We will use the SWITCH function in Google Sheets to convert these numbers to months.
Let’s divide the process of getting a month from a given date into two steps.
Task: Get a month from the hiring date of each employee. We have 20 records that need to be organized by Month.
Step #1 – Extract Month (Number) from a given Date
In this step, we will use the Month function in Google Sheets to get an integer value for the month from a given date.
Firstly, we will add two columns, “Month Number” and “Month Name”. Refer to the following image.
Now, Let’s begin.
- Open the Google Sheet.
- Click on the first cell below the header “Month Number”
- Type “=month”
- Select the first option from the popup or press “Tab” on your keyboard
- Provide the cell reference as “B2”
- Complete the bracket using “)”
- Press “Enter” on your keyboard
The final formula should look like this:
=MONTH(B2)
It will instantly return the month for the first date in B2.
You can apply the above formula to the rest of the cells by using the Auto Fill feature or hovering to the lower-rightmost corner of the cell “C2” (where we have used the MONTH function) until you see an “+” icon.
Next, click on that icon and simply drag the formula to the end of the table.
PRECAUTION – #VALUE! Error
If you will face any error, it should be due to an invalid date format.
Make sure to use the proper format for all dates. To check and validate the date formats in Google Sheets, check out the last section of this article.
Step #2 – Converting the Numbers to Date using the SWITCH function
This step is crucial to convert the month number we obtained in the previous step.
We will use the SWITCH function, which is a simple array formula in Google Sheets with the following syntax,
=SWITCH(expression, case, value)
Each argument needs to be replaced with the proper information,
- “expression” – Each case or condition defined by the users is tested against an expression for further calculations. You can type the expression or function manually or select the cell reference containing the same
- “case” – It represents a value (condition) which is compared with the values obtained from the expressions
- “value” – It is the output you expect from the SWITCH function if the value defined in the “case” argument matches with the results obtained from the “expression” argument
Note that the SWITCH function is an array formula capable of performing multiple calculations to obtain the desired output. You can define any number of cases or conditions, and there is no limit.
We will convert 1 to January, 2 to February, 3 to March, and so on until 12 December.
- Select the first cell below the header “Month Name”
- Type “=switch”
- Select the first option from the popup or press “Tab” on your keyboard
- Next, for the “expression” argument, we will use the MONTH function by providing the cell reference value as “C2”
- Press “,” on your keyboard to move to the next argument
- The condition will be to convert 1 to January. So, we will put “1” in the place of the “case1” argument
- Press “,”
- Type “January” to replace the “value1” argument
(Make sure to put the January in double quotation marks; otherwise, the SWITCH function will return an error in the end.) - Press “,” to move to the next argument
- Now, for the second condition of converting 2 to February, let us put “2” in the place of the “case2_or_default, …” argument
- Type “February” to replace the “value2, …” argument and make sure to use the double quotation marks
- Press “,”
- Follow the same process from steps 6 to 8 for the rest of the months from March to December
- Complete the bracket using “)”
- Press “Enter”
The final formula will be as below,
=SWITCH(C2,1,"January",2,"February",3,"March",4,"April",5,"May",6,"June",7,"July",8,"August",9,"September",10,"October",11,"November",12,"December")
The CHOOSE function is capable of returning the same results. However, I think the SWITCH function is easier to use than the CHOOSE function. You can experiment with this method using the CHOOSE function and get the date from the numbers.
How to Get the Month name from Date in Google Sheets using the TEXT function
In contrast to the method discussed above, the TEXT function is easy to use and quick. It doesn’t rely on any other function for obtaining the month name.
The general syntax for the SWITCH function is as follows,
=TEXT(number, format)
Here is how to deal with each argument from the above formula
- “number” – It needs to be replaced with the date from which you wish to extract the month
- “format” – This argument decides the format of the month depending on the input provided. Here are your options:
- “mmm” – It returns the month as a short name, e.g. August will be “Aug”
- “mmmm” – It returns the full name of the month
Now that you understand the TEXT month let us use it to get the month from the date.
Task: Get the month for each employee’s hiring date. Refer to the following table.
Here are the steps,
- Open the Google Sheet
- Type “=text”
- Select the first option from the popup or press “Tab” on your keyboard
- Now, select the cell reference value as “B2”
- Press “,” on your keyboard to move to the next argument
- As we need the full name of the month, we will simply put “mmmm” in place of the “format” argument
(Make sure to use double quotation marks; otherwise, the TEXT function won’t work and will return an error.) - Complete the brackets using “)”
- Press “Enter”
The final formula should look like this:
=TEXT(B2,"mmmm")
To use this formula for the rest of the cells, hover to the lower-rightmost corner of cell C2 until you see an “+” icon. Then, click on that icon and drag the formula to the end of the table.
Conclusion
So, it is possible to extract the date from a given month. If you use the MONTH function by Google Sheets, you have to go for an extra workaround using the SWITCH function to get the month’s full name.
On the other hand, the TEXT function is pretty straightforward. It returns the month’s full name without relying on the SWITCH function.
That’s it!
I hope this article taught you about extracting the month from a given date in Google Sheets. We have discussed two simple and quickest methods. You can also use Apps Scripts, but it requires expert knowledge.
Let me know if you need any help using the above methods to get the month from a date in the comment section below. I will try to answer all of your questions as soon as possible.