Category: FUNCTION | Updated: 2026-11-22

How to Use the EOMONTH Function in Google Sheets | Get the Last Day of a Specified Month

How to Use the EOMONTH Function

The EOMONTH (End Of Month) function returns the last day (month-end date) of the month that is a specified number of months before or after a given start date. It is indispensable for calculating invoice payment due dates (e.g., end of next month) and setting monthly reporting periods.

Syntax

=EOMONTH(start_date, months)
  • start_date: The reference date.
  • months: An integer specifying how many months before or after start_date to shift:
    • 0: Last day of the same month (current month-end)
    • 1: Last day of the next month (next month-end)
    • -1: Last day of the previous month (previous month-end)

Examples

Here are examples of calculating current month-end, next month-end, previous month-end, and month-start dates from Column A.

A (Reference Date) B (Months) C (Formula) Result Description
2026/11/22 0 =EOMONTH(A2, B2) 2026/11/30 Last day of the current month (Nov)
2026/11/22 1 =EOMONTH(A3, B3) 2026/12/31 Last day of the next month (Dec)
2026/11/22 -1 =EOMONTH(A4, B4) 2026/10/31 Last day of the previous month (Oct)
2028/02/10 0 =EOMONTH(A5, B5) 2028/02/29 Automatically detects leap-year Feb end
2026/11/22 -1 =EOMONTH(A6, B6)+1 2026/11/01 Adds 1 to previous month-end to get current month’s 1st

Common Errors and Tips

  • Fixing serial number display: If the cell format is “Automatic”, entering the formula may display a serial number like 46356. Set Format > Number > Date.
  • Weekends and holidays are not excluded: EOMONTH returns the pure calendar month-end. If you need the last business day when month-end falls on a weekend or holiday, combine it with WORKDAY: WORKDAY(EOMONTH(A2, 0)+1, -1).
  • #VALUE! error: Occurs if start_date is not a valid date or references text with full-width digits.

Frequently Asked Questions

Q. Can I use EOMONTH to find the first day of a month (the 1st)?

A. Yes. Add 1 to the end of the previous month. For example, to get the 1st of the current month, write "=EOMONTH(reference_date, -1) + 1".

Q. Does EOMONTH automatically return February 29 in leap years?

A. Yes. EOMONTH automatically accounts for leap years, returning "February 29" in years like 2024 or 2028 and "February 28" in non-leap years.