Sub topic 2
EOMONTH: the last day of a month, shifted by n months
Prerequisites and the working model
This chapter assumes that you know basic Excel formulas, relative and absolute references, and the layout of a column-based financial model. You should also know that Excel stores dates as serial numbers: whole numbers represent days, and formatting makes those numbers appear as dates.
EOMONTH returns the last day of a month. Its syntax is:
=EOMONTH(start_date, months)The start_date can be a date or a cell containing a date. The months argument is the number of months to move. Use 0 for the month containing the start date, a positive number to move forward, and a negative number to move backward.
Basic EOMONTH examples
Assume the model starts on 15 January 2025.
=EOMONTH(DATE(2025,1,15),0) -> 31-Jan-2025
=EOMONTH(DATE(2025,1,15),1) -> 28-Feb-2025
=EOMONTH(DATE(2025,1,15),-1) -> 31-Dec-2024The day of the input date does not affect the result. The function always returns the final calendar day of the target month.
| Formula | Target month | Result |
|---|---|---|
| `=EOMONTH(DATE(2025,1,15),0)` | January 2025 | 31-Jan-2025 |
| `=EOMONTH(DATE(2025,1,15),1)` | February 2025 | 28-Feb-2025 |
| `=EOMONTH(DATE(2025,1,15),-1)` | December 2024 | 31-Dec-2024 |
If the result displays as a number such as 45688, the formula is still working. Select the cell and apply a date format. A date format changes how the serial number appears; it does not change the underlying value.
Finding month starts
A common pattern uses the previous month-end date and adds one day:
=EOMONTH(DATE(2025,1,15),-1)+1 -> 01-Jan-2025This works because the day after 31 December is 1 January. In a model, the formula can reference one start-date input:
C2 = DATE(2025,1,15)
D5 = EOMONTH($C$2,-1)+1
D6 = EOMONTH($C$2,0)Here, D5 is the first day of the starting month and D6 is its last day. The dollar signs make the input reference absolute, so copying the formula does not move the input cell.
Building reliable period ends
For monthly model columns, use the first period end from the input date, then step from the previous period end:
D6 = EOMONTH($C$2,0)
E6 = EOMONTH(D6,1)
F6 = EOMONTH(E6,1)This produces 31 January, 28 February, and 31 March 2025. It also handles leap years automatically.
An alternative is to calculate every column from the original input with a period counter:
D8 = 0
E8 = D8+1
D6 = EOMONTH($C$2,D8)This avoids depending on a prior column. Either approach is valid. The important rule is that every period end must be a true month end.
Why EOMONTH is the right period anchor
EOMONTH is designed for reporting periods. It gives every month a consistent boundary, regardless of whether the input date is the 1st, 15th, or 31st. EDATE instead shifts a date while trying to preserve its day number, so it is generally better for events such as anniversaries or payment dates.
For a timeline, month-end dates make later formulas easier. You can derive the next period start as the previous period end plus one day:
E5 = D6+1You can also calculate the number of days in each period:
D7 = D6-D5+1Exercise
Exercise
If C2 contains 20-Aug-2024, what do these formulas return: =EOMONTH(C2,0), =EOMONTH(C2,1), and =EOMONTH(C2,-2)?
Show answer
They return 31-Aug-2024, 30-Sep-2024, and 30-Jun-2024.