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)| Argument | What it means | |
|---|---|---|
start_date | Required | Any date inside the starting month. |
months | Required | Months 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
| A | B | C | |
|---|---|---|---|
| 1 | Invoice | Invoice date | Due date |
| 2 | INV-3307 | 2026-03-15 | 2026-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
| A | B | |
|---|---|---|
| 1 | Transaction date | Month start |
| 2 | 2026-03-15 | 2026-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
| A | B | |
|---|---|---|
| 1 | Today | Days left incl. today |
| 2 | 2026-12-02 | 30 |
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
| A | B | |
|---|---|---|
| 1 | Date | Sales |
| 2 | 2026-03-02 | 1200 |
| 3 | 2026-03-19 | 850 |
| 4 | 2026-03-31 | 430 |
| 5 | 2026-04-01 | 990 |
| 6 | ||
| 7 | Month | 2026-03-01 |
| 8 | 2480 |
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.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#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(...)+1for 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.
| Language | Function name |
|---|---|
| Danish | SLUT.PÅ.MÅNED |
| Dutch | LAATSTE.DAG |
| Finnish | KUUKAUSI.LOPPU |
| French | FIN.MOIS |
| German | MONATSENDE |
| Hungarian | HÓNAP.UTOLSÓ.NAP |
| Italian | FINE.MESE |
| Norwegian (Bokmål) | MÅNEDSSLUTT |
| Polish | NR.SER.OST.DN.MIES |
| Portuguese (Brazil) | FIMMÊS |
| Portuguese (Portugal) | FIMMÊS |
| Russian | КОНМЕСЯЦА |
| Spanish | FIN.MES |
| Swedish | SLUTMÅNAD |
| Turkish | SERİAY |
Recipes that use EOMONTH
- How to add months to a date in Excel
- How to get the first and last day of the month in Excel
- How to sum values by month in Excel