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
Example 1. End of this month
=EOMONTH(A2, 0)If A2 is 2026-05-04, the result is 2026-05-31.
Example 2. Payment at the end of next month
=EOMONTH(A2, 1)2026-06-30.
Example 3. First day of this month
=EOMONTH(A2, -1)+1The end of last month plus one day is the first of this month.
Common mistakes
Leaving out months
EOMONTH requires months. For the end of this month, enter 0.
The result looks like a number
EOMONTH also returns a serial number, so format the result cell as a date.
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.