SpreadsheetFormulas
beginnerEOMONTH

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.

Quick formula
=EOMONTH(A2,0)
Sample input
1InvoiceIssued
2INV-5012026-07-08
3INV-5022026-02-14
Result
1InvoiceDue (Month End)
2INV-5012026-07-31
3INV-5022026-02-28

Excel & Google Sheets

=EOMONTH(A2,0)

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.

A2
Any date in the month you care about.
0
Months to shift: 0 = this month's end, 1 = next month's end, -1 = last month's end.

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

  • Hardcoding the 30th or 31st.

    =DATE(YEAR(A2),MONTH(A2),31) breaks in February, April, June, September, and November. EOMONTH always knows the real month length.

  • The result shows a serial number like 46224.

    EOMONTH returns a date value; the cell just isn't formatted. Apply a date format.

  • Using 1 when you meant 0.

    The second argument is an offset, not a flag. =EOMONTH(A2,1) is the end of *next* month — use 0 for the current month's end.

Did this formula help?

Engine-verified against the sample data aboveDownload the proof sheet (.xlsx)Last reviewed 2026-07-09