How to use EOMONTH in Excel
EOMONTH returns the last day of the month, a given number of months before or after a date. Typical uses: payment terms "end of next month", month-end reports, the number of days in a month.
Syntax
=EOMONTH(start_date, months)
start_date | Any date in the starting month. |
months | 0 = same month, 1 = next month, −1 = previous month… |
Examples
=EOMONTH(A2, 0)Last day of A2's month.=EOMONTH(A2, 1)Due date at the end of next month.=EOMONTH(A2, -1)+1First day of A2's month.=DAY(EOMONTH(A2, 0))Number of days in the month (28–31).Month-end dates for reports and schedules
Banking reports, accruals and payment schedules run on month ends. EOMONTH gives the last day of any month, before or after a date, and handles 28, 29, 30 and 31 by itself.
=EOMONTH(A2, 0)The last day of the month of A2.=EOMONTH(A2, -1)The last day of the previous month: the reporting date for last month.=EOMONTH($A$2, ROW()-2)A list of month ends: copy it down from row 2.First day of the month
There's no "start of month" function, but the day after the previous month end is always the first.
=EOMONTH(A2, -1)+1The first day of the month of A2.=EOMONTH(TODAY(), -1)+1The first day of the current month.Totals by month
Use the first and last day of the month as the two date conditions in SUMIFS.
=SUMIFS(C2:C500, A2:A500, ">="&EOMONTH(F2, -1)+1, A2:A500, "<="&EOMONTH(F2, 0))The total for the month of the date in F2.Common mistakes
- A number appears
- EOMONTH returns a date serial — format the cell as a date.
- Want the same day next month
- Use EDATE:
EDATE(A2, 1).
Frequently asked questions
What's the difference between EOMONTH and EDATE?
EOMONTH always gives the last day of a month. EDATE gives the same day a number of months later: 15 January plus one month is 15 February.
Why does EOMONTH return a number?
Dates are numbers in Excel. Format the cell as Short Date.
How many days are in a month?
=DAY(EOMONTH(A2, 0)) gives 28, 29, 30 or 31 for the month of A2.
How do I get the last working day of the month?
=WORKDAY(EOMONTH(A2, 0)+1, -1) steps back from the first day of the next month to the last working day. More in NETWORKDAYS.
Available in: All versions of Excel, Excel for the web, Google Sheets