The EOMONTH function in Excel
EOMONTH (end of month) returns the last day of the month, a given number of months before or after a date. Use it for payment terms like "end of next month", for monthly reporting periods, and to find the first day of a month or the number of days in it. Finance and accounting tests use it often.
Syntax
=EOMONTH(start_date, months)
| start_date | Any date in the month you're counting from. |
|---|---|
| months | How many months to move. 0 is the end of the same month, 1 the end of next month, -1 the end of last month. |
Try it yourself
This is a live spreadsheet. Type the formula and press Enter.
These invoices are due at the end of the month after they're issued. In D2, use EOMONTH to find the due date for the invoice date in B2.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Due date | ||||||
| 2 | |||||||
| 3 | |||||||
| 4 | |||||||
| 5 | |||||||
| 6 | |||||||
| 7 | |||||||
| 8 |
Tip: The second argument counts months from the invoice date. 0 would be the end of the same month.
Examples
=EOMONTH(B2,0)→ 45688Returns the last day of the invoice's own month, Jan 31, 2025. Like other date results it comes back as a serial number. Format the cell as a Date to show it.
=DAY(EOMONTH(B3,0))→ 29DAY of the month's last date is the number of days in that month. February 2024 was a leap year, so this gives 29.
=TEXT(EOMONTH(B4,-1)+1,"mmm d, yyyy")→ "Nov 1, 2025"The end of last month plus one day is the first day of this month. It's the standard way to get the start of a reporting period.
Example data
| 1 | Invoice | Invoice date | Amount |
|---|---|---|---|
| 2 | INV-301 | 1/17/2025 | 1200 |
| 3 | INV-302 | 2/9/2024 | 850 |
| 4 | INV-303 | 11/3/2025 | 430 |
Common mistakes
Leaving out the months argument
EOMONTH needs both arguments, so Excel won't accept
=EOMONTH(B2). Use0for the end of the same month.The result shows as a number
A result like 45688 is a date serial number. Format the cell as a Short Date to see it.
Expecting the first day with -1
EOMONTH(B2,-1)is the last day of the previous month. Add 1 to get the first day of this month.EOMONTH inside quotes in SUMIFS
"<=EOMONTH(F1,0)"is just text. Join the operator to the function:"<="&EOMONTH(F1,0).
FAQ
How do I get the first day of the month in Excel?+
Go to the end of the previous month and add one day: =EOMONTH(A2,-1)+1.
How do I find how many days are in a month?+
Take the day number of the month's last date: =DAY(EOMONTH(A2,0)). It returns 28, 29, 30 or 31.
How do I total sales for one month?+
Use SUMIFS with the first and last day: =SUMIFS(C2:C50,B2:B50,">="&F1,B2:B50,"<="&EOMONTH(F1,0)), where F1 holds the first day of the month.
Lesson
Master EOMONTH step by step: Renewals and month-ends: EDATE, EOMONTH, WEEKDAY
Shift dates by whole months with EDATE, jump to month-end with EOMONTH, and find the day of the week with WEEKDAY.