The function MONTH converts a date or time period to a month in number format.

This function is useful if you want to easily compare months to see if they're the same. 

MONTH(Value to convert, [Time period method]) 

ArgumentData typeDescription
Value to convertDate, time periodThe date or time period to convert to a month, as a number.
Time period method (optional)KeywordDetermines whether to extract the month from the start, middle, or end of a time period.

The keywords for the time period method argument are:

  • START, the default method, returns the month for the first date in the time period
  • MID, which returns the month for the date in the middle of the time period
  • END, which returns the month for the last date in the time period

The MONTH function returns a number.

MONTH

The example below shows MONTH(Value to convert). The values to convert are taken from the Product date and Month period line items. They are date and time period formatted respectively. The MONTH function returns the same result. 


Key datesExpiry dates
Product released16/02/201623/08/2017
Month period Feb 16Aug 17

Product month

MONTH(Product released)

28

Month number

MONTH(Month period)

28

The next example shows MONTH(TIME. 'Period'). An explicit time reference is used instead of a line item.


Key dates

Year Number 

MONTH(TIME. 'Apr 16')

4

The final example shows the effect of the Time period method argument. An explicit time reference is used with a keyword to determine which date in a time period to extract the month from.


Product: Plums
Start of fiscal yearJan FY2019

Month Start

MONTH(Start of fiscal year, START)

1

Month Mid

MONTH(TIME. 'Q1 FY19', MID)

2

Month End

MONTH(TIME. 'Q1 FY19', END)

3