
Returns the last day of the month before or after a given date.
The Excel EOMONTH function returns the last day of the month before or after a given date.
EOMONTH is useful for month-end reporting, accounting cutoffs, billing periods, due dates, lease schedules, and any workbook that needs a clean month-end boundary.
Calculates the final calendar day of a month based on a start date and month offset.
Returns a valid Excel date for the last day of the target month.
=EOMONTH(start_date, months)
start_date is the anchor date. months tells Excel how many months forward or backward to move before returning the month-end date.
0 for the current month, positive values for future months, and negative values for past months.These functions both shift dates by months, but they do not return the same kind of result.
| Function | Returns | Best Use | Example |
|---|---|---|---|
EOMONTH |
Last day of the target month | Month-end cutoffs and reporting | =EOMONTH(A1,0) |
EDATE |
Same day number in another month | Month-based due dates and renewals | =EDATE(A1,1) |
Use EOMONTH when you need the end of a month. Use EDATE when you want to preserve the day position as much as possible.
EOMONTH is especially useful when dates arrive on many different days but your reporting needs a consistent month-end result. For example, invoices dated throughout May can all be converted to May 31 for monthly reporting.
The second argument controls the shift. A value of 0 keeps the current month, 1 moves to next month, and -1 moves to the previous month. Microsoft also notes that if months is not an integer, it is truncated.
A common pattern is DAY(EOMONTH(date,0)), which returns the total number of days in the month. That makes EOMONTH useful for monthly proration as well as reporting cutoffs.
Use EOMONTH with a zero month offset to get the last day of the same month.
=EOMONTH(A1,0)
If A1 contains 2026-01-15, the result is the final day of January 2026.
In cell F1, return the last day of the month for A1 with =EOMONTH(A1,0).
Change the month offset to move forward before taking the month end.
=EOMONTH(A1,1)
This returns the final day of the following month. It is useful for billing cycles, contract periods, and rolling schedules.
In cell F2, return the last day of the following month from A1.
Wrap EOMONTH in DAY to get the total number of days in the target month.
=DAY(EOMONTH(A1,0))
This pattern automatically handles different month lengths and leap years, so it is useful for monthly calculations and proration logic.
In cell F3, calculate the total number of days in the month for A1.
You can also combine EOMONTH with MONTH to jump to the final day of the year.
=EOMONTH(B1,12-MONTH(B1))
If B1 is any date in 2026, the result is December 31, 2026. This is a useful year-end cutoff pattern.
In cell F4, return the last day of the year for the date in B1.
EOMONTH returns the last day of a month.DAY(EOMONTH(date,0)) returns the number of days in a month.Tell your friends about this post