Example 1
Last day of the same month
B2 =EOMONTH(A2,0)
Result: 31-Mar-2025
With months set to 0, EOMONTH stays in March and returns 31-Mar-2025.
B2 =EOMONTH(A2,0) returns 31-Mar-2025
Returns the last day of the month, a given number of months before or after a start date.
Syntax
=EOMONTH(, )
All versions of Excel.
Try it
Edit the formula in B2 or change the inputs. The sheet recalculates as you type.
B2 =EOMONTH(A2,0) returns 31-Mar-2025
EOMONTH returns the last day of a month. =EOMONTH(A2,0) with 15 March 2025 in A2 returns 31 March 2025. The result is a date serial number, so give the cell a date format. Both arguments are required, even when you want the current month: EOMONTH(A2,0), not EOMONTH(A2).
1 is next month's end, -1 is the previous month's end, and 3 is three month-ends later. Zero stays in the same month.EOMONTH handles leap years and different month lengths for you. =EOMONTH(DATE(2024,2,10),0) is 29 February 2024, and the same formula for 2025 gives 28 February.
Month-ends are the natural reporting date in finance. EOMONTH gives one consistent date for every row in a month, so it makes a good grouping key: a helper column of =EOMONTH(A2,0) lets SUMIFS total by month and a pivot table group on it. It is also the shortest route to other month boundaries:
=EOMONTH(A2,-1)+1.=EOMONTH(A2,0)+1.=DAY(EOMONTH(A2,0)).=EOMONTH(A2,1).=EOMONTH(A2,MOD(3-MONTH(A2),3)). In January, February and March it returns 31 March; in October it returns 31 December.Start with a month-end in one cell and add =EOMONTH(A2,1) in the next. Fill right or down. Each cell moves one month on from the one before it, and no cell lands on the wrong day when a month is short, which a simple "add 30 days" or DATE(…,…,31) approach can't promise.
EDATE keeps the day number (31 January plus one month is 28 February, the nearest valid day) and EOMONTH always returns the last day. Use EDATE for same-day-of-month events such as subscription renewals, and EOMONTH for statement dates and month-end reporting.
#VALUE!.0 is the end of the same month, 1 is the end of next month, and -1 is the end of last month. A fraction is cut off, so 1.9 is treated as 1.Each example is a live sheet. Change the inputs or the formula and watch the result.
Example 1
B2 =EOMONTH(A2,0)
Result: 31-Mar-2025
With months set to 0, EOMONTH stays in March and returns 31-Mar-2025.
B2 =EOMONTH(A2,0) returns 31-Mar-2025
Example 2
B2 =EOMONTH(A2,3)
Result: 28-Feb-2026
Terms of three month-ends after the invoice month: 28-Feb-2026. EOMONTH knows February 2026 has 28 days.
B2 =EOMONTH(A2,3) returns 28-Feb-2026
Example 3
B2 =EOMONTH(A2,-1)+1
Result: 01-Mar-2025
The end of the previous month is 28 February. Adding 1 gives 1-Mar-2025.
B2 =EOMONTH(A2,-1)+1 returns 01-Mar-2025
Example 4
B2 =EOMONTH(A2,MOD(3-MONTH(A2),3))
Result: 30-Jun-2025
May is month 5. MOD(3-5,3) is 1, so the formula moves one month on to the end of June: 30-Jun-2025. In a quarter-end month MOD gives 0.
B2 =EOMONTH(A2,MOD(3-MONTH(A2),3)) returns 30-Jun-2025
Solve it in the sheet. Every answer is checked, with hints if you need them.
Task 1 of 2
In B2, return the last day of the month of the invoice date in A2. Fill it down to B4.
Answer in B2, then it fills down to B4.
45747, apply a date format.=EOMONTH(A2) is rejected, so write =EOMONTH(A2,0) for the current month.months are cut off, not rounded. EOMONTH(A2,1.9) moves one month.#VALUE!, and a start date before 1900 returns #NUM!.Use `=EOMONTH(A2,0)`, where A2 is any date in the month. Format the cell as a date.
Take the end of the previous month and add one: `=EOMONTH(A2,-1)+1`.
EDATE moves a date by whole months and keeps the day number where it can. EOMONTH moves by whole months and always returns that month's last day.
Subtract the date from the month-end: `=EOMONTH(A2,0)-A2`. Add 1 if you want to count the start date as well.
Yes. `=EOMONTH(A2,-1)` returns the last day of the previous month, and `-12` the last day of the same month a year ago.
EOMONTH is taught in Dates and financial modelling, lesson 5: Month ends with EOMONTH. Each lesson is a short, graded exercise like the one above.