formulastreak

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

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.

Freelance invoices · edit G2 and watch it recalculate
Click a cell (or use the arrow keys) to insert its address · Enter shows the resultG2 = 31 Jan 2026
ABCDEFG
1InvoiceYearMonthDayAmountDateMonth end
2INV-3012026128$1,250.0028 Jan 202631 Jan 2026
3INV-302202623$480.003 Feb 2026
4INV-3032026217$2,200.0017 Feb 2026
5INV-304202639$975.009 Mar 2026
6INV-3052026331$640.0031 Mar 2026
7INV-3062026414$1,830.0014 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. 1. EOMONTH: Gives the last day of the month that F2 is in.
    • date = `F2`: the starting date
    • months = `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)+1 and EOMONTH(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

ArgumentRequiredWhat it is
start_dateYesThe date to count from.
monthsYesHow 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)+1 is the first day of the next month, EOMONTH(A2,-1)+1 the 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

  • #NUM!: start_date isn't a valid date, or moving by months lands on a date that isn't valid.
  • #####: The column is too narrow for the date format.

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.

Practise EOMONTH on a live sheet

Lesson 26, Dates (Unit 6, Text and dates), has 6 graded exercises, checked instantly, with steps and hints when you're stuck. Pro