The MONTH function returns the month of the specified date.
This function can be useful when you need to analyze data by month or group information by time.
Syntax
MONTH(date)
Argument |
Description |
Permitted values |
|---|---|---|
date |
The date to retrieve the month number from |
Reference to a cell containing a date, a function that returns a date value, a row containing a date in a valid format |
Examples of use
Retrieving the month from a date
If cell A1 contains the date 03/15/2023, you can obtain the month number as follows:
=MONTH(A1)
This formula will return 3, as March is the third month of the year.
Working with date in text form
You can also use the text representation of the date:
=MONTH("2023-07-25")
In this case, the result will be 7, since July is the seventh month.
Use with the current date
To obtain the current month's number, you can use the TODAY function:
=MONTH(TODAY())
This formula will return the number of the month of the current date.
Notes
–The MONTH function returns a number between 1 and 12, where 1 corresponds to January and 12 corresponds to December.
–If the argument is not a valid date, the function will return the #VALUE! error.