Excel functions · Dates

EOMONTH function in Excel

EOMONTH returns the last day of the month a given number of months before or after a date, such as 31 January 2026 for any date in January. It's used for due dates, month-end reporting and, with +1, the first day of a month.

Last reviewed

Syntax

=EOMONTH(start_date, months)
start_daterequired
Any date in the starting month.
monthsrequired
How many months to move: 0 for the same month, 1 for next month, -1 for the month before.
  • Dates in Excel are serial numbers. If a result shows as a number such as 46053 (31 January 2026), format the cell as a date.
  • First day of the month: =EOMONTH(date, -1)+1.
  • Leap years are handled: EOMONTH(DATE(2028,2,1), 0) is 29 February 2028.

Which versions have EOMONTH

Every current Excel version: Microsoft 365, Excel for the web, Excel 2024, 2021, 2019 and 2016, on Windows and Mac.

EOMONTH availability by Excel version
VersionHas it
Microsoft 365 (Windows and Mac)Yes
Excel for the webYes
Excel 2024Yes
Excel 2021Yes
Excel 2019Yes
Excel 2016Yes

Google Sheets

Google Sheets has EOMONTH with the same arguments.

Examples

The examples use this sample sheet.

Invoices (A1:B3)
RowAB
1InvoiceInvoice date
2INV-012026-01-15
3INV-022026-02-10
  1. 1.End of the same month

    =EOMONTH(B2, 0)

    Result: 2026-01-31

    The last day of January 2026.

  2. 2.Due at the end of next month

    =EOMONTH(B3, 1)

    Result: 2026-03-31

    One month after February, then its last day.

  3. 3.First day of the month

    =EOMONTH(B2, -1)+1

    Result: 2026-01-01

    The end of the previous month (31 December 2025) plus one day.

Common errors and fixes

EOMONTH errors, causes and fixes
ErrorWhy it happensFix
#VALUE!start_date is text Excel can't read as a date.Re-enter it as a date or convert it with DATEVALUE.
#NUM!The result would fall outside the dates Excel supports, such as before 1900.Check start_date and months.
A number instead of a dateThe cell is formatted as General or Number.Format the cell as a date.

Do it with GPTExcel

Skip writing EOMONTH by hand

Upload your Excel or CSV file to Chat and ask in plain English. GPTExcel writes the formula for your file and your version of Excel or Google Sheets.

your-file.xlsx

Add a due date at the end of the month after each invoice date.

Done. I used EOMONTH on your sheet and checked the results against your data.

your-file-updated.xlsxYour original stays unchanged
  • Written for your platform and version
  • Checked against your actual data
  • Newest functions looked up in official docs
Try it free Formula Generator

Free plan, no credit card.

EOMONTH questions

How do I get the first day of the month in Excel?
Take the end of the previous month and add one day: =EOMONTH(B2, -1)+1.
Why does EOMONTH return a number like 46053?
That's the date's serial number. Format the cell as a date and it shows 2026-01-31.

Skip the formula hunt

Upload a spreadsheet and ask in plain English. Free plan, no credit card.

Start free