Skip to content

EOMONTH

Returns the last day of the month, a given number of months before or after a start date.

Syntax

=EOMONTH(, )

Date and time

All versions of Excel.

Try it

Edit the formula in B2 or change the inputs. The sheet recalculates as you type.

B2
A
B
C
1
Invoice date
Month end
2
15-Mar-2025
31-Mar-2025
3

B2 =EOMONTH(A2,0) returns 31-Mar-2025

How EOMONTH works

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).

The two arguments

  • start_date is any date in the month you start from. The day doesn't matter: EOMONTH of the 3rd and of the 28th return the same result.
  • months moves the target month forward or back. 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.

Why it is so useful

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:

  • First day of the month: =EOMONTH(A2,-1)+1.
  • First day of next month: =EOMONTH(A2,0)+1.
  • Days in the month: =DAY(EOMONTH(A2,0)).
  • Payment due at the end of next month: =EOMONTH(A2,1).
  • Quarter-end: =EOMONTH(A2,MOD(3-MONTH(A2),3)). In January, February and March it returns 31 March; in October it returns 31 December.

A month-by-month timeline

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.

EOMONTH or EDATE

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.

Arguments

start_date
The date to count from. Use a cell holding a date or a date built with DATE. Text that Excel can't read as a date returns #VALUE!.
months
How many months to move. 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.

Examples

Each example is a live sheet. Change the inputs or the formula and watch the result.

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
A
B
C
1
Invoice date
Month end
2
15-Mar-2025
31-Mar-2025
3

B2 =EOMONTH(A2,0) returns 31-Mar-2025

Example 2

Payment due at the end of the next month

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
A
B
C
1
Invoice date
Due date
2
20-Nov-2025
28-Feb-2026
3

B2 =EOMONTH(A2,3) returns 28-Feb-2026

Example 3

First day of the month

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
A
B
C
1
Date
Month start
2
15-Mar-2025
01-Mar-2025
3

B2 =EOMONTH(A2,-1)+1 returns 01-Mar-2025

Example 4

Quarter-end date for any date

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
A
B
C
1
Date
Quarter end
2
09-May-2025
30-Jun-2025
3

B2 =EOMONTH(A2,MOD(3-MONTH(A2),3)) returns 30-Jun-2025

Your turn.

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.

B2
A
B
C
D
E
1
Invoice date
Statement date
Due (end of next month)
2
17-Jan-2025
3
03-Feb-2025
4
30-Dec-2025
5

Common mistakes

  • The result is a serial number. If the cell shows 45747, apply a date format.
  • Both arguments are required. =EOMONTH(A2) is rejected, so write =EOMONTH(A2,0) for the current month.
  • Fractions in months are cut off, not rounded. EOMONTH(A2,1.9) moves one month.
  • EOMONTH always returns the last day. It does not keep the day of the start date, so it is the wrong tool for a monthly renewal on the 15th. Use EDATE.
  • Text dates that Excel can't read return #VALUE!, and a start date before 1900 returns #NUM!.

Questions people ask

How do I get the last day of the month in Excel?

Use `=EOMONTH(A2,0)`, where A2 is any date in the month. Format the cell as a date.

How do I get the first day of the month with EOMONTH?

Take the end of the previous month and add one: `=EOMONTH(A2,-1)+1`.

What is the difference between EOMONTH and EDATE?

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.

How do I count the days left in the month?

Subtract the date from the month-end: `=EOMONTH(A2,0)-A2`. Add 1 if you want to count the start date as well.

Does EOMONTH work with a negative number of months?

Yes. `=EOMONTH(A2,-1)` returns the last day of the previous month, and `-12` the last day of the same month a year ago.

Learn EOMONTH in a real sheet.

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.