Returns a date representing the last day of a month which falls a specified number of months before or after another date.
Sample usage
EOMONTH(DATE(1969, 7, 20), 1)
EOMONTH(A2, 1)
EOMONTH(40909, -2)
Syntax
EOMONTH(start_date, months)
-
start_date
– The date from which to calculate the the result. -
months
– The number of months before (negative) or after (positive) start_date to consider. The last calendar day of the calculated month is returned.
Notes
-
Ensure that the
start_date
input to the function is either a reference to a cell containing a date, a function which returns a date object, such as DATE, DATEVALUE or TO_DATE, or a date serial number of the type returned by the N function. Google Sheets represents dates and times as numbers; while conversion is automatic when a human-readable date is entered into a cell, functions only accept literal dates in numeric format. -
EOMONTH
does not auto-convert number formats in the same way as Google Sheets does upon direct entry into cells. Therefore,EOMONTH(10/10/2000,1)
is interpreted asEOMONTH(0.0005,1)
, the quotient of 10 divided by 10 divided by 2000. -
Non-integer arguments to
months
will have their decimal components truncated. Therefore,EOMONTH(A2,2.6)
is equivalent toEOMONTH(A2,2)
.
See also
TO_DATE
: Converts a provided number into a date.
N
: Returns the argument provided as a number.
EDATE
: Returns a date that is a specified number of months before or after another date.
DATEVALUE
: Converts a provided date string in a known format into a date value.
DATE
: Converts a year, month and day into a date.
Examples
Returns the date of the last day of a month which falls months
away from the given start_date.