Start free
Date & time

EOMONTH function

EOMONTH returns the last day of a month, a number of months before or after a date: =EOMONTH(A2,0) is the end of A2's month, and =EOMONTH(A2,1) the end of the next one.

Available in Excel 2007 and later, Excel for the web and Google Sheets

Key takeaways

  • =EOMONTH(date, 0) is the last day of that date's month; months moves you forward or back.
  • The first day of a month is the day after the end of the one before: =EOMONTH(A2,-1)+1.
  • It knows leap years: the end of February 2028 is the 29th.
  • Format the result as a date, or it shows as a serial number.
On this page

EOMONTH syntax

=EOMONTH(start_date, months)
ArgumentRequiredWhat it means
start_dateYesAny date in the month to start from.
monthsYes0 for the same month, 1 for the next, -1 for the one before. A decimal part is dropped.

Examples

The end of this month

Months set to 0 stays in the same month. April has 30 days.

B2=EOMONTH(A2,0)
RowAB
1Invoice dateMonth end
217 Apr 202630 Apr 2026
=EOMONTH(A2,0) → 30 Apr 2026

Due at the end of next month

Months set to 1 jumps to the end of the next month, here across the new year.

B2=EOMONTH(A2,1)
RowAB
1IssuedDue
220 Dec 202631 Jan 2027
=EOMONTH(A2,1) → 31 Jan 2027

The first day of a month

The end of last month, plus one day.

B2=EOMONTH(A2,-1)+1
RowAB
1DateMonth starts
223 Jun 20261 Jun 2026
=EOMONTH(A2,-1)+1 → 1 Jun 2026

How many days a month has

DAY of a month's last day is the number of days in it. 2028 is a leap year, so February has 29.

B2=DAY(EOMONTH(A2,0))
RowAB
1MonthDays
210 Feb 202829
=DAY(EOMONTH(A2,0)) → 29

Practise it

New data, so you can't copy the answer above. We check the number your formula returns, then change the data to make sure it still holds.

Your task: Benefits start on the first day of the month after someone is hired. In B2, return that date for the hire date in A2.

Graded live
RowAB
1HiredBenefits start
218 Mar 2026

Write the formula in the bar above, then press Check or Enter.

Hint

EOMONTH(A2,0) is the last day of A2's month. The day after it is the first of the next month.

Solution

=EOMONTH(A2,0)+1 Any formula that returns the same result passes.

Common mistakes

  1. Leaving out months. months isn't optional. Use 0 for the month the date is in.
  2. Expecting the first day of the month. EOMONTH always returns a month's last day. For the first, add 1 to the end of the month before.
  3. A result that shows as a number. EOMONTH returns a serial number. Format the cell as a date.

FAQ

How do I get the last day of the previous month?

=EOMONTH(A2,-1), or =EOMONTH(TODAY(),-1) for the month before today's.

How do I count the days in a month?

=DAY(EOMONTH(A2,0)): the day number of the month's last day is how many days it has.

Should I use EOMONTH or EDATE?

EOMONTH when you want month ends: due dates, reporting periods. EDATE when you want the same day of the month, such as a contract that ends on the 15th.

Guides that use EOMONTH

Worked problems with practice sheets.

Interview prepPractice sheet

Working days and due dates: Excel interview question

Invoices due at the end of next month, and the working days a client has to pay: the date task interviewers set, solved with EOMONTH and NETWORKDAYS, plus a sheet that grades yours.

3 min read · Updated

Know EOMONTH? Prove it on a real sheet.

Practise EOMONTH and the functions around it in a live grid that grades your result and explains your mistakes.

Runs in your browser · Graded on your result · No install