Dates

Excel EOMONTH: first and last day of the month

EOMONTH(date, months) returns the last day of the month that is "months" away. Adding 1 to the previous month's end gives the first day.

All Excel versions and Google Sheets

The formula

Last day of the monthExcelGoogle Sheets
=EOMONTH(A2,0)
In C2 → Feb 28, 2026
First day of the monthExcelGoogle Sheets
=EOMONTH(A2,-1)+1
In C3 → Feb 1, 2026
Days in the monthExcelGoogle Sheets
=DAY(EOMONTH(A2,0))
In C4 → 28
First day of next monthExcelGoogle Sheets
=EOMONTH(A2,0)+1
In C5 → Mar 1, 2026
✓ Tested. All 4 Excel results in this example were recalculated in LibreOffice Calc 25.2 and matched the values shown.

Worked example

Paste the data below into a blank sheet starting at cell A1 (or download the cheat sheet, where every example is set up). Highlighted cells hold the formulas and show the expected results.

ABC
1Date
2Feb 14, 2026Feb 28, 2026
3Feb 1, 2026
428
5Mar 1, 2026

How it works

A2
Any date in the month.
0
This month. -1 = previous month, 1 = next month.
+1
The day after a month-end is the 1st of the next month.

Common errors and fixes

Shows 46081 or similar?

Format as a date.

Why does the formula return #VALUE!?

The input is text, not a date.

Does this work in Google Sheets?

Yes. The formulas on this page work the same way in Google Sheets.