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)+1In 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)+1In 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.
| A | B | C | |
|---|---|---|---|
| 1 | Date | ||
| 2 | Feb 14, 2026 | Feb 28, 2026 | |
| 3 | Feb 1, 2026 | ||
| 4 | 28 | ||
| 5 | Mar 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.