Back to Functions

EOMONTH

Returns a date representing the last day of a month which falls a specified number of months before or after another date.

DateEOMONTH(start_date, months)

EOMONTH returns the last day of the month, a given number of months before or after a start date. It saves you from working out whether a month has 28, 29, 30 or 31 days, and it is the basis for month-end reporting, billing cycles, due dates and monthly date lists.

Syntax

=EOMONTH(start_date, months)
  • start_date: The reference date.
  • months: How many months to move. 0 is the same month, 1 is next month, -1 is last month.

The result is a date serial number, so format the cell as a date (Format > Number > Date).

Basic examples

With A2 containing March 10, 2026:

=EOMONTH(A2, 0)

Returns March 31, 2026: the end of the same month.

=EOMONTH(A2, 1)

Returns April 30, 2026.

=EOMONTH(A2, -1)

Returns February 28, 2026.

=EOMONTH(DATE(2028, 1, 15), 1)

Returns February 29, 2028. Leap years are handled automatically.

First day of the month

There is no "start of month" function, but adding one to the end of the previous month works:

=EOMONTH(A2, -1) + 1

Returns March 1, 2026 for the example above. This pairing of first and last day is the foundation of month-based reports.

Practical patterns

Number of days in a month

=DAY(EOMONTH(A2, 0))

Returns 31 for March.

Days remaining in the month

=EOMONTH(TODAY(), 0) - TODAY()

Is a date in the current month?

=AND(A2 >= EOMONTH(TODAY(), -1) + 1, A2 <= EOMONTH(TODAY(), 0))

Totals for a given month

With any date in the month in F1:

=SUMIFS(C2:C1000, A2:A1000, ">=" & (EOMONTH(F1, -1) + 1), A2:A1000, "<=" & EOMONTH(F1, 0))

Sums the amounts dated within that month.

Month-end due dates

=EOMONTH(A2, 1)

An invoice dated in March is due at the end of April.

A list of month-ends

=ARRAYFORMULA(EOMONTH(DATE(2026, 1, 1), SEQUENCE(12, 1, 0, 1)))

Returns the 12 month-end dates of 2026. For month-starts, add 1 to EOMONTH(..., SEQUENCE(12, 1, -1, 1)).

Quarter end

=EOMONTH(A2, MOD(3 - MONTH(A2), 3))

Moves forward to the last month of the quarter, then to its end. For March 10 it returns March 31, and for May 5 it returns June 30.

Fiscal year end

=EOMONTH(DATE(YEAR(A2) + (MONTH(A2) > 6), 6, 1), 0)

The June 30 fiscal year end: dates in July and later roll to the next year. Adjust the month numbers for your fiscal calendar.

Group by month

=EOMONTH(A2, 0)

Converts any date into its month-end, which makes a clean grouping key for QUERY, SUMIF or a pivot table.

Add months without overflowing

EDATE(A2, 1) keeps the same day number, and EOMONTH always lands on the last day. For a "same day next month, or the last day if it doesn't exist" rule, EDATE already clamps (January 31 plus one month gives February 28 or 29).

Common errors

  • A number such as 46112 instead of a date. Format the cell as a date.
  • #VALUE!. start_date is text. Convert it with DATEVALUE, or use DATE(year, month, day).
  • #NUM!. The date is out of range or months is not a number.
  • Off by a day with the "first of month" trick. Remember it is EOMONTH(date, -1) + 1, not EOMONTH(date, 0) + 1, which is the first of next month.
  • Fractional months. months is truncated to a whole number.

EOMONTH vs. EDATE vs. DATE

  • EOMONTH returns the last day of a month.
  • EDATE returns the same day number, N months away.
  • DATE(year, month + 1, 0) also returns the last day of a month, but EOMONTH is clearer.

Frequently asked questions

Does EOMONTH handle leap years? Yes. It returns February 29 in leap years.

How do I get the first day of the month? =EOMONTH(A2, -1) + 1.

Can EOMONTH work on a column? Yes: =ARRAYFORMULA(EOMONTH(A2:A, 0)), with IF to skip blanks.

What does EOMONTH(A2, 0) return if A2 is the last day already? The same date.

Related Functions

  • EDATE: Returns a date a given number of months away.
  • TODAY: Returns the current date.
  • DATEDIF: Calculates the difference between two dates.
  • NETWORKDAYS: Counts working days between two dates.
  • SEQUENCE: Generates a series of numbers.

Related Articles

Newsletter

More EOMONTH examples coming soon.

We are building short, practical updates for Sheets power users.