Spreadsheet Practice

EOMONTH function

EOMONTH returns the last day of the month a number of months before or after a date. Use it for month-end reporting, end-of-month payment terms, and, with a +1, the first day of a month. A months value of 0 means the same month as the start date.

Available in
Every current version
Category
Date functions
Returns
The date of the last day of that month, as a serial number.
Google Sheets
Works the same in Google Sheets.

Syntax

=EOMONTH(start_date, months)

ArgumentRequired?What it is
start_dateRequiredThe date to start from.
monthsRequiredHow many months away. 0 is the same month, 1 is next month, -1 is last month.

Examples

Each result below is calculated from the sample sheet by our formula engine, the same one that grades the practice.

CellFormulaResultWhat it shows
C2=EOMONTH(A2,0)2/28/2026Last day of the same month: February 28
C3=EOMONTH(A3,1)12/31/2026End of next month, for "end of month plus one" terms
C4=EOMONTH(A4,-1)+16/1/2026First day of the invoice's month: end of last month plus one

Try it live

This is the sample sheet. Change any number or text, or edit a formula, and the results update.

Show the sample data as a table
Invoice dateResult
2/10/20262/28/2026
11/20/202612/31/2026
6/5/20266/1/2026

Practice EOMONTH

From lesson 18, EDATE, EOMONTH & NETWORKDAYS. Graded instantly, then re-checked on changed data.

Bill at month-end

In E2, return the last day of each contract's start month. Fill down to E6.

Common mistakes

What you seeWhy, and how to fix it
A five-digit number instead of a dateEOMONTH returns a serial number. Format the cell as a date.
Leaving out the months argumentUnlike some functions, months is required. Use 0 for the end of the same month.
Grouping by month-end shifts dates into the next monthEOMONTH(A2,1) is next month's end. For the month a date belongs to, use 0.

Tips

  • Group transactions by month with a helper column of =EOMONTH(A2,0); every date in a month maps to the same value.

Questions

How do I get the last day of the month in Excel?

Use =EOMONTH(A2,0). It returns the last day of the month that contains the date in A2.

How do I get the first day of the month?

Add one to the end of the previous month: =EOMONTH(A2,-1)+1.

Does EOMONTH handle leap years?

Yes. EOMONTH of any date in February 2028 returns February 29, 2028.

Lessons that use EOMONTH

Last reviewed October 2026. Every example result on this page is calculated live by the Spreadsheet Practice formula engine.