Date and time
EOMONTH function playground
Returns the last day of the month, a number of months before or after a date.
The playground runs in your browser. Nothing you type is sent anywhere.
How EOMONTH works
EOMONTH moves forward or back the number of months you give, then jumps to the last day of that month. It handles 28, 29, 30 and 31-day months for you.
Add 1 to the result of EOMONTH(date,-1) to get the first day of a date's month.
Syntax
=EOMONTH(start_date, months)| Argument | What it means |
|---|---|
start_daterequired | The date to start from. |
monthsrequired | How many months to move: 0 for the same month, 1 for next month, -1 for last month. |
Examples
| Formula | What it does | Result |
|---|---|---|
=EOMONTH(B2,C2) | Due at the end of the month after the terms. | 1/31/2026 · 2/28/2026 · 3/31/2026 · 5/31/2026 … |
=EOMONTH(B2,0) | End of the invoice month. | 1/31/2026 · 1/31/2026 · 2/28/2026 · 3/31/2026 … |
=EOMONTH(B2,-1)+1 | First day of the invoice month. | 1/1/2026 · 1/1/2026 · 2/1/2026 · 3/1/2026 … |
=EOMONTH(B2,C2)-B2 | Days the customer has to pay. | 17 · 28 · 50 · 70 … |
Common mistakes
Result shows as a numberFormat the cell as a date if you see something like 46081.
Expecting the same dayEOMONTH always returns a month end. Use EDATE to keep the day of the month.
Related functions
Learn more
Download the example workbook (.xlsx)
The workbook has the same sample data and formulas, plus a practice sheet.