SheetSense

Last day of the month with EOMONTH

EOMONTH returns the last day of the month that is a chosen number of months before or after a date. With 0 it is the month the date is in.

fx
=EOMONTH(A2,0)

The sheet: Column A holds invoice dates. You want the last day of the month each date falls in, for month-end reporting.

How it works, step by step

  1. 01A2 is the date.
  2. 020 means this month. Use 1 for next month end or -1 for the previous month end.
  3. 03The result is a serial date number, so apply a date format to read it.

The same logic in four tools

Excel
=EOMONTH(A2,0)
Google Sheets
=EOMONTH(A2,0)
SQL
SELECT (date_trunc('month', invoice_date) + INTERVAL '1 month - 1 day')::date AS month_end
FROM invoices;  -- PostgreSQL
Python (pandas)
df["month_end"] = df["invoice_date"] + pd.offsets.MonthEnd(0)

Mistakes that break it

  • !Without a date format the result displays as a number such as 46112.
  • !The first day of the month is =EOMONTH(A2,-1)+1.
  • !The dates must be real dates. Text such as "2026-03-05" may return #VALUE!.

Common questions

How do I get the first day of the month?
Use =EOMONTH(A2,-1)+1, the day after the previous month end.
Does it handle leap years?
Yes, EOMONTH(DATE(2028,2,10),0) returns February 29, 2028.

Got a version of this with your own ranges?

Paste it into the free translator and get the same breakdown for your exact formula. To run it against a real file, upload the CSV and describe the formula you need in a sentence.