Dates function
EOMONTH function in Google Sheets and Excel
EOMONTH returns the last day of a month, a given number of months before or after a date.
Checked against Microsoft's and Google's documentation on · Example calculated on a live sheet
- Excel 2016
- Excel 2019
- Excel 2021
- Excel 2024
- Microsoft 365
- Google Sheets
Syntax
EOMONTH(start_date, months)Arguments in [brackets] are optional. Google Sheets writes it EOMONTH(start_date, months).
Example
=EOMONTH(F2,0) reads: Take the invoice date in F2, stay in the same month (0 months), and return that month's last day.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Invoice | Year | Month | Day | Amount | Date | Month end |
| 2 | INV-301 | 2026 | 1 | 28 | $1,250.00 | 28 Jan 2026 | 31 Jan 2026 |
| 3 | INV-302 | 2026 | 2 | 3 | $480.00 | 3 Feb 2026 | |
| 4 | INV-303 | 2026 | 2 | 17 | $2,200.00 | 17 Feb 2026 | |
| 5 | INV-304 | 2026 | 3 | 9 | $975.00 | 9 Mar 2026 | |
| 6 | INV-305 | 2026 | 3 | 31 | $640.00 | 31 Mar 2026 | |
| 7 | INV-306 | 2026 | 4 | 14 | $1,830.00 | 14 Apr 2026 |
G2 shows 31 Jan 2026: the last day of the month INV-301 was dated in.
How the spreadsheet calculates it
Gives the last day of the month that F2 is in.
- 1. EOMONTH: Gives the last day of the month that
F2is in.date=`F2`: the starting datemonths=`0`: how many months to move first
More EOMONTH examples
=EOMONTH(F2,1)The last day of the month after the invoice date: "end of next month" terms.=EOMONTH(F2,-1)+1The first day of the invoice's month.=DAY(EOMONTH(F2,0))How many days the invoice's month has.=EOMONTH(TODAY(),0)-TODAY()Days left until the end of this month.
Paste any of these into the formula explainer to see it step by step.
Tips
- Use 0 for this month, 1 for next, -1 for last: the number is a month offset, not a day count.
EOMONTH(A2,-1)+1andEOMONTH(A2,0)make a month's first and last day: a ready pair for SUMIFS limits.- February in leap years is handled for you.
What EOMONTH is used for
Payment terms like "due at the end of next month", month-end reporting dates, monthly buckets for totals, and counting the days in any month without a table of month lengths.
Arguments
| Argument | Required | What it is |
|---|---|---|
| start_date | Yes | The date to count from. |
| months | Yes | How many months to move before taking the month's last day: 0 for the same month, 1 for the next, -1 for the one before. Decimals are cut to whole months. |
Common mistakes
Leaving out the months argument: EOMONTH needs both.
Adding 1 to get the first of the next month and forgetting it:
EOMONTH(A2,0)+1is the first day of the next month,EOMONTH(A2,-1)+1the first day of this month.Seeing a number like 46053: the cell needs a date format.
In Google Sheets
Google Sheets has EOMONTH with the same two arguments (start_date, months), so it gives the same end-of-month dates in both apps.
Errors you may see with EOMONTH
Questions
How do I get the first day of the month?
Take the end of the previous month and add a day: EOMONTH(A2,-1)+1 is the 1st of A2's month.
How many days are in a month?
Read the day of its last date: DAY(EOMONTH(A2,0)) gives 28, 29, 30 or 31.
What's the difference between EOMONTH and EDATE?
EDATE keeps the day of the month (15 Jan + 1 month = 15 Feb); EOMONTH always jumps to the month's last day (15 Jan + 1 month = 28 Feb in 2026).
How do I sum a whole month with EOMONTH?
Use it for the upper limit in SUMIFS: SUMIFS(amounts, dates, ">="&start, dates, "<="&EOMONTH(start,0)) adds everything from the first to the last day.
Sources
Official documentation the facts on this page were checked against.