Excel function

EOMONTHfunction

Returns the last day of the month a number of months later (or earlier).

All versions
=EOMONTH(DATE(2026,5,4), 0)

May 2026

Sun
Mon
Tue
Wed
Thu
Fri
Sat

Click a date on the calendar to change start_date. Change months to -1 to get the last day of the previous month. Add 1 to that and you get the first day of this month. Try breaking it on purpose to see the errors.

Result

2026-05-31

start_date
May 4, 2026 (Mon)

The starting date. Which day of the month it is does not affect the result.

months

Which month's last day to return. 0 is the same month; negative goes back.

What is the EOMONTH function?

=EOMONTH(start_date, months)

EOMONTH returns the last day of the month a number of months after (or before) the start date. The name stands for End Of Month.

The last day is the 28th, 29th, 30th or 31st depending on the month, so working it out by hand is error-prone. Whatever day the start date is, the result is always a month end.

Arguments

start_date
The starting date.
months
0 gives the end of the same month, 1 next month, -1 last month. Decimals are dropped.

EOMONTH examples

  1. Example 1. End of this month

    =EOMONTH(A2, 0)

    If A2 is 2026-05-04, the result is 2026-05-31.

  2. Example 2. Payment at the end of next month

    =EOMONTH(A2, 1)

    2026-06-30.

  3. Example 3. First day of this month

    =EOMONTH(A2, -1)+1

    The end of last month plus one day is the first of this month.

Common mistakes

FAQ

How do I get the number of days in a month?
Take the day of the month end: =DAY(EOMONTH(A2, 0)).
The result shows a number like 46146.
Excel stores dates as serial numbers, with January 1, 1900 as 1. Format the result cell as a date and it shows like 2026-05-04. The value is the same, so calculations are fine.