Date & Time
Last Day of Month
Get the last day of the month for any given date. Automatically handles months with 28, 29, 30, or 31 days including leap years.
Excel Formula
=EOMONTH(A2, 0)Step-by-Step Explanation
1
EOMONTH returns the last day of a month
2
A2 is any date in the target month
3
0 means the same month as A2
4
Use 1 for next month's end, -1 for previous month's end
5
Handles leap years automatically
Example
| Date (A) | Last Day (B) |
|---|---|
| 2/10/2026 | 2/28/2026 |
| 2/10/2028 | 2/29/2028 |
| 7/15/2026 | 7/31/2026 |
Result: Formula in B2: =EOMONTH(A2,0) → 2/28/2026
Common Variations
Days remaining in month
=EOMONTH(A2,0)-A2Days left in current month
Last day of next month
=EOMONTH(A2,1)End of following month
First day of month
=EOMONTH(A2,-1)+1First day of the current month
Need a Custom Version?
Use our AI generator to create a formula tailored to your specific data and requirements.
Try It with AI →