The MONTH function in Google Sheets is a versatile tool that allows users to easily extract the month component of a date in numeric form. This function is particularly useful for financial analyses, project management, and any task requiring a breakdown of data by month.
Syntax
MONTH(date)
- date: A date formatted as a date value or a cell reference containing the date. This is the date from which the month will be extracted.
Example #1
=MONTH("2023-10-05")
This function call returns the month of the provided date, yielding a result of 10, which corresponds to October.
Example #2
=MONTH(A1)
If cell A1 contains the date 2023-05-15, this formula will return 5, indicating May as the extracted month.
Example #3
=MONTH(DATE(2022, 12, 25))
In this case, the function extracts the month from December 25, 2022, and returns 12, representing December.
Error handling
- VALUE!: This error occurs when the input provided to the MONTH function is not a valid date, such as text or a non-date number.
- N/A: This error indicates that the date value is unrecognized, possibly due to incorrect formatting.
- NUM!: This error relates to invalid inputs, such as a date that is too far in the past or future, resulting in an inability to compute the month.