English

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.

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

Arguments

Argument Data type Description
Value to convert Date, time period The date or time period to convert to a month, as a number.
Time period method (optional) Keyword Determines whether to extract the month from the start, middle, or end of a time period.

The keywords for thetime period methodargument 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,whichreturns the month for the last date in the time period

The MONTH function returns a number.

Excel equivalent

Examples

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


Key dates Expiry dates
Product released 16/02/2016 23/08/2017
Month period Feb 16 Aug 17

Product month

月(Product released)

2 8

Month number

月(Month period)

2 8

The next example shows月(时间。'Period').An explicit time reference is used instead of a line item.


Key dates

Year Number

月(时间。'Apr 16')

4

The final example shows the effect of theTime period methodargument. 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 year Jan FY2019

Month Start

月(Start of fiscal year, START)

1

Month Mid

月(时间。'Q1 FY19', MID)

2

Month End

月(时间。“Q1 FY19”,结束)

3

Disclaimer

We update Anapedia content regularly to provide the most up-to-date instructions.