Find the Last Day of the Month for Any Date
Invoices are due at month end, reports close on the last day of the month — and that day floats between the 28th and the 31st, so you need it computed from any date.
Excel & Google Sheets
This formula works in both Excel and Google Sheets.
How it works
EOMONTH takes a date and an offset in months, then returns the last day of the resulting month. An offset of 0 means the same month — any date in July 2026 returns 31 July 2026 — and the function knows every month length, including 28-day Februaries and leap years. Change the offset to look ahead or back: =EOMONTH(A2,1) is the end of next month (a classic "due end of following month" payment term), and =EOMONTH(A2,-1) is the end of last month, handy for prior-period cutoffs. The result is a real date, so it plugs straight into overdue checks and countdowns.
When to use it
Use it for invoice due dates set to month end, billing-period cutoffs, subscription period ends, and month-end close checklists tied to the real last day.
Common mistakes
Did this formula help?
Engine-verified against the sample data aboveDownload the proof sheet (.xlsx)Last reviewed 2026-07-09