The EOMONTH function
EOMONTH (end of month) gives the last day of a month. Use 0 for the month the date is in, or move forwards or backwards by whole months.
It handles different month lengths and leap years for you, which makes it ideal for payment terms like "end of next month".
=EOMONTH(start_date, months)
Arguments
- start_date
- Any date in the starting month.
- months
- How many months to move: 0 for the same month, 1 for next month, -1 for last month.
Try it
=EOMONTH(A2,1) in B2. One month on from March is April, and April's last day is the 30th.
B2
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Invoice date | Due | ||
| 2 | 14 Mar 2025 | 30 Apr 2025 | ||
| 3 | 31 Jan 2025 | |||
| 4 | ||||
| 5 | ||||
| 6 |
Edit the formula in B2, or change the data, and press Enter.
More examples
| Formula | Result | What it does |
|---|---|---|
| =EOMONTH(A2,0) | 31 Mar 2025 | The end of the same month. |
| =EOMONTH(A2,-1)+1 | 1 Mar 2025 | The end of last month plus one day is the 1st of this month. |
| =EOMONTH(A3,1) | 28 Feb 2025 | February 2025 has 28 days. |
| =EOMONTH(DATE(2024,2,10),0) | 29 Feb 2024 | 2024 was a leap year. |
Tips
=EOMONTH(A2,-1)+1is the standard way to get the first day of a date's month.- Number of days in a month:
=DAY(EOMONTH(A2,0)). - Format the result as a date; otherwise you'll see a serial number.
Common mistakes
- The result shows a number like 45777.Format the cell as a date.
- You wanted the same day next month, not the month end.Use EDATE for that.
- EOMONTH(A2,1) gives the end of this month.0 is this month and 1 is next month. Check the months argument.
Practise EOMONTH with instant feedback
Type real formulas into a working spreadsheet and get told straight away whether they work.