Syntax

EOMONTH(when, offset-months)

Arguments

  • when (Date or DateTime)
  • offset-months (Number): A number of months to add to or subtract from when before computing the last day of the month. For instance, 0 would find the end of the month specified by when; 1 would find it for the month after when; and -1 would find it for the month prior.

Return Value

Date: The date of the last day of the month specified by when if when is recognized as a Date or DateTime value.

Examples

EOMONTH("3/15/2020", 3) : 6/30/2020

EOMONTH("2/1/2020", 0) : 2/29/2020

EOMONTH(TODAY(), 0) or EOMONTH(NOW(), 0): Last day of the current month. Equivalent to (DATE((MONTH(TODAY()) + 1) & "/1/" & YEAR(TODAY())) - 1). See also: DAY(), MONTH(), NOW(), TODAY(), YEAR().

EOMONTH(TODAY(), 1) : Last day of next month.

EOMONTH(TODAY(), -1) : Last day of last month. Equivalent to (TODAY() - DAY(TODAY())).

EOMONTH(TODAY(), 0) + 1 : First day of next month. Equivalent to DATE((MONTH(TODAY()) + 1) & "/1/" & YEAR(TODAY())).

EOMONTH(TODAY(), -1) + 1 : First day of this month. Equivalent to (TODAY() - DAY(TODAY()) + 1).

EOMONTH(TODAY(), -2) + 1 : First day of last month.

EOMONTH(TODAY(), 0) + DAY(TODAY()) : One month from today.

EOMONTH(TODAY(), -1) + DAY(TODAY()) : Today. Equivalent to TODAY().

EOMONTH(TODAY(), -2) + DAY(TODAY()) : One month ago today.

(DAY(EOMONTH(("2/1/" & (YEAR(TODAY()) + 1)), 0)) > 28) (returnsYes/No): TRUE if next year is leap year.

See Also

DAY(), MONTH(), WORKDAY()

Did this answer your question?