Date & time function

EOMONTH function

Returns the last day of the month a given number of months before or after a date — perfect for month-end due dates and reports.

Available in Excel 2007 and later (earlier versions needed the Analysis ToolPak add-in), Excel for the web

Excel 2007 and laterWorks in Google Sheets

Syntax

EOMONTH(start_date, months)
ArgumentWhat it means
start_dateRequiredAny date inside the starting month.
monthsRequiredMonths to move: 0 = same month, 1 = next month, -1 = previous month.

Returns: A date serial number for the last day of the target month.

How EOMONTH works

EOMONTH ("end of month") jumps to the final day of a month. EOMONTH(date, 0) is the last day of the same month, EOMONTH(date, 1) the last day of the next month, and so on. Accounting runs on month ends, so this function turns up everywhere: "payment due end of next month" terms, month-end closing dates, and grouping transactions by period.

Because it always lands on the correct final day — 28, 29, 30 or 31 — it removes the need to remember month lengths or leap years. A popular trick is EOMONTH(date, -1) + 1, which gives the first day of the date's month: go to the end of the previous month, then add one day.

As with EDATE, the result is a serial number that needs a date format, and the months argument is truncated to a whole number.

Examples

1Payment terms: end of the following month

C2fx=EOMONTH(B2,1)
ABC
1InvoiceInvoice dateDue date
2INV-33072026-03-152026-04-30

Result: 2026-04-30

One month after March is April, and EOMONTH returns April's last day (cell formatted as yyyy-mm-dd).

2First day of the month

B2fx=EOMONTH(A2,-1)+1
AB
1Transaction dateMonth start
22026-03-152026-03-01

Result: 2026-03-01

EOMONTH(A2,-1) is 28 Feb 2026; adding one day gives 1 March 2026 (cell formatted as yyyy-mm-dd). Useful as a month key for grouping.

3Days left in the month

B2fx=EOMONTH(A2,0)-A2+1
AB
1TodayDays left incl. today
22026-12-0230

Result: 30

The month ends on 31 Dec. 31 Dec − 2 Dec = 29, plus 1 to include today, gives 30 days (cell formatted as General).

4Sum sales for one month

B8fx=SUMIFS(B2:B5,A2:A5,">="&B7,A2:A5,"<="&EOMONTH(B7,0))
AB
1DateSales
22026-03-021200
32026-03-19850
42026-03-31430
52026-04-01990
6
7Month2026-03-01
82480

Result: 2480

The criteria keep dates from 1 March up to EOMONTH(B7,0) = 31 March, so 1200 + 850 + 430 = 2480. The April sale is excluded.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 17 KB

Common errors and how to fix them

ErrorWhy it happensFix
#VALUE!start_date is not a valid date or is a multi-cell range (older versions).Reference a single date cell.
#NUM!The result falls outside Excel's date range.Check the months argument.

Tips

  • =DAY(EOMONTH(A2,0)) returns the number of days in A2's month.
  • When comparing with <=EOMONTH(...), remember that a date-time such as 31 Mar 2026 15:00 is later than 31 Mar 2026 00:00; use <EOMONTH(...)+1 for timestamps.
  • For a quarter end, combine with MONTH: =EOMONTH(A2, MOD(3-MONTH(A2),3)).

Questions

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

Use =EOMONTH(A2,0) and format the cell as a date.

How do I get the first day of the month?

Use =EOMONTH(A2,-1)+1, or =DATE(YEAR(A2),MONTH(A2),1).

Google Sheets

EOMONTH also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.

EOMONTH in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
DanishSLUT.PÅ.MÅNED
DutchLAATSTE.DAG
FinnishKUUKAUSI.LOPPU
FrenchFIN.MOIS
GermanMONATSENDE
HungarianHÓNAP.UTOLSÓ.NAP
ItalianFINE.MESE
Norwegian (Bokmål)MÅNEDSSLUTT
PolishNR.SER.OST.DN.MIES
Portuguese (Brazil)FIMMÊS
Portuguese (Portugal)FIMMÊS
RussianКОНМЕСЯЦА
SpanishFIN.MES
SwedishSLUTMÅNAD
TurkishSERİAY

Recipes that use EOMONTH