Returns the month of the year (1
to 12
) if identifiable, a fixed default month if a Time
value is provided, or 0
if a month is not found.
Sample usage
MONTH(TODAY())
: This month. See also: TODAY()
MONTH([Birthday])
: Someone's birth month.
Month name
Convert today's month number to the month name:
INDEX(
LIST(
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
),
MONTH(TODAY())
)
LIST("Jan", "Feb", "Mar", ...)
enumerates the 12 month names,MONTH(TODAY())
gets the month number (1 to 12) for today.INDEX(..., ...)
gets the month name fromLIST(...)
corresponding to the month number returned byMONTH(...)
.
See also: INDEX()
, LIST()
, TODAY()
Last month
(MOD((MONTH(TODAY()) - 1 + 12 - 1), 12) + 1)
MONTH(TODAY())
gets today's month number in the range 1...12.... - 1
converts month number from (1) to the range 0...11.... + 12
converts month number from (2) to the range 12...23.... - 1
steps month number from (3) back one ("last month"), giving a month number in the range 11...22. Use... + 1
instead to step ahead one month ("next month") instead, giving a range of 13...24.MOD(..., 12)
converts the adjusted month number from (4) to the range 0...11.(... + 1)
converts the adjusted month from (5) to 1...12.
Equivalent to MONTH(EOMONTH(TODAY(), - 1))
.
See also: EOMONTH()
, MOD()
, TODAY()
Syntax
MONTH(when)
when
- ADate
,DateTime
, orTime
value.
Note
Some constant values, such as "MM/DD/YYYY"
, are evaluated as a Date
value by AppSheet. Similarly, "000:00:00"
is evaluated as a Duration
value. This doesn't mean your spreadsheet data must use the same formats: the date and time formats in your spreadsheets are determined by the locale/language setting. Column will always be evaluated as the type of column. Additionally, you can convert data, both columns and string literals, to specific types using functions such as DATE()
, TIME()
, or DATETIME()
.