Get the Last Day of a Month
Return reliable month-end dates from any valid date with EOMONTH, including short months, leap years, and year rollovers, with an independent DATE-based reconciliation for verification.
| Get Last Day of Month, Formula Review | |||||||||
| Compare EOMONTH with the equivalent DATE construction across leap years and year boundaries. | |||||||||
| Month-end examples | Formula review | ||||||||
| Reference date | Offset | EOMONTH | DATE alternative | Example | Formula syntax | Result | |||
| Feb 12, 2024 | 0 | Feb 29, 2024 | Feb 29, 2024 | Leap-year February | =EOMONTH($A$12,0) | Feb 29, 2024 | |||
| Feb 12, 2025 | 0 | Feb 28, 2025 | Feb 28, 2025 | Non-leap February | =EOMONTH($A$13,0) | Feb 28, 2025 | |||
| Apr 7, 2025 | 0 | Apr 30, 2025 | Apr 30, 2025 | Next month | =EOMONTH($A$14,1) | May 31, 2025 | |||
| Dec 20, 2025 | 1 | Jan 31, 2026 | Jan 31, 2026 | Prior month | =EOMONTH($A$15,-1) | Nov 30, 2025 | |||
| Jan 15, 2024 | -1 | Dec 31, 2023 | Dec 31, 2023 | Date alternative | =DATE(YEAR($A$12),MONTH($A$12)+1,0) | Feb 29, 2024 | |||
| Jan 31, 2025 | 0 | Jan 31, 2025 | Jan 31, 2025 | ||||||
| Reliability checks | |||||||||
| Leap-year February returns 29-Feb-2024 | OK | ||||||||
| Non-leap February returns 28-Feb-2025 | OK | ||||||||
| EOMONTH and DATE alternatives agree for every example | OK | ||||||||
Overview
Return the final calendar day of the month containing a reference date, or of a month before or after it. EOMONTH handles different month lengths, leap years, and December-to-January transitions automatically. Each formula returns one Excel date.
When to use it
Use it for forecast headers, accounting cutoffs, accrual periods, monthly debt schedules, and reporting selectors that require true calendar month-ends. The offset can remain zero or advance through a sequence of whole months.
When not to use it
Use EDATE when the day number should be preserved rather than forced to month-end. Combine EOMONTH with workday logic when the cutoff must be the last working day. Use a complete timeline Block when headers also require actual/forecast flags, period numbers, or fiscal labels.
Problem
Adding 30 or 31 days creates drift because calendar months vary in length. Hardcoded February logic also fails in leap years. A reliable calculation must let the calendar determine each final day and continue correctly across year boundaries.
Inputs
Input | Location | Sample |
|---|---|---|
Schedule anchor | | 15-Jan-2025 |
Month offsets | | 0 through 5 |
Source data
The calculation needs a valid Excel date and a whole-number month offset. The example schedule uses:
Offset | Expected month-end |
|---|---|
0 | 31-Jan-2025 |
1 | 28-Feb-2025 |
2 | 31-Mar-2025 |
3 | 30-Apr-2025 |
4 | 31-May-2025 |
5 | 30-Jun-2025 |
Offsets may be negative. Sorting and duplicates are irrelevant because each row is calculated independently.
Calculations
- Read the valid reference date.
- Interpret zero as the reference month, positive offsets as later months, and negative offsets as earlier months.
- Return the last valid day in the target month with EOMONTH.
- Recalculate by constructing day zero of the following month with DATE.
- Compare both results across the schedule.
Outputs
Starting from 15-Jan-2025, the six outputs run from 31-Jan-2025 through 30-Jun-2025. February correctly returns 28 days. The result is stored as a date serial and requires date formatting for a readable display.
Formula map
EOMONTH calculation
=EOMONTH($J$11,A12)
The anchor is absolute and the offset is relative so the formula can fill down.
DATE reconciliation
=DATE(YEAR($J$11),MONTH($J$11)+A12+1,0)
Day zero rolls back from the following month to the target month’s final day.
Model checks
The workbook confirms the first schedule date is 31-Jan-2025, offset 5 returns 30-Jun-2025, and every EOMONTH output matches its DATE-based alternative. Passing checks return OK.
Edge cases
- February 2024 returns 29-Feb because it is a leap year.
- February 2025 returns 28-Feb.
- Positive and negative offsets cross year-end automatically.
- An already month-end date with offset zero remains unchanged.
- An unrecognized text date produces an error or unreliable coercion.
- EOMONTH does not preserve an earlier day within the month.
Common errors
- Adding fixed days: outputs drift across different month lengths. Use EOMONTH.
- Using EDATE: the result may preserve the day rather than return period-end. Match the function to the convention.
- Ignoring date formatting: a correct date serial appears as a number. Apply a date number format.
Example
For anchor 15-Jan-2025 and offset 1, EOMONTH returns 28-Feb-2025. Independently, DATE constructs day zero of March 2025, which rolls back to the same date. The workbook also confirms that February 2024 returns 29-Feb-2024.
Example workbook
Replace the cream anchor in Combined Example!J11 or edit offsets in A12:A17. EOMONTH and DATE results appear side by side. Formula Review tests leap years, non-leap years, prior months, future months, and year rollover.
Key takeaway
Let the calendar determine month-end: EOMONTH converts a date and whole-month offset into a reliable period boundary without hardcoded day counts.