Returns the date of the last day of a month from Date
or DateTime
value.
Sample usage
EOMONTH("3/15/2020", 3)
returns 6/30/2020
EOMONTH("2/1/2020", 0)
returns 2/29/2020
EOMONTH(TODAY(), 0)
or EOMONTH(NOW(), 0)
returns last day of the current month.
EOMONTH(TODAY(), 1)
returns last day of next month.
EOMONTH(TODAY(), -1)
returns last day of last month. Equivalent to (TODAY() - DAY(TODAY()))
.
EOMONTH(TODAY(), 0) + 1
returns first day of next month.
EOMONTH(TODAY(), -1) + 1
returns first day of this month. Equivalent to (TODAY() - DAY(TODAY()) + 1)
.
EOMONTH(TODAY(), -2) + 1
returns first day of last month.
EOMONTH(TODAY(), 0) + DAY(TODAY())
returns one month from today.
EOMONTH(TODAY(), -1) + DAY(TODAY())
returns today. Equivalent to TODAY()
.
EOMONTH(TODAY(), -2) + DAY(TODAY())
returns one month ago today.
(DAY(EOMONTH(("2/1/" & (YEAR(TODAY()) + 1)), 0)) > 28)
(returns Yes/No
) returns TRUE
if next year is leap year.
Syntax
EOMONTH(when, offset-months)
when
- ADate
orDateTime
value.offset-months
(Number
): A number of months to add to or subtract fromwhen
before computing the last day of the month. For instance,0
would find the end of the month specified bywhen
;1
would find it for the month afterwhen
; and-1
would find it for the month prior towhen.
Note
When dates are used as constant values within an expression, they must be represented in the MM/DD/YYYY
format. This doesn't mean your spreadsheet data must use dates in this format: the date representation in your spreadsheets is determined by the locale/language of the spreadsheet. When reading a date from a localized spreadsheet, such as DATE([Column])
, AppSheet takes care of the localization.