Quick Answer

EOMONTH Function

Returns the last day of the month offset by n months.

✓ Excel✓ Google SheetsExcel All versions

Syntax

EOMONTH
(start_date, months)

Parameters

ParameterDescriptionRequired
start_dateThe starting date serial.Required
monthsThe number of months to move. Positive moves forward, negative moves backward. The value is truncated to an integer.Required

Basic Example

Last day of the same month

=EOMONTH(DATE(2024, 1, 15), 0)
Result45321

Zero months offset returns the end of January 2024, which is Jan 31 (serial 45321).

Advanced Examples

Example 1: Last day of the next month in a leap year

Computing February month-end

One month forward lands on Feb 29 in 2024

=EOMONTH(DATE(2024, 1, 15), 1)
Result: 45350
2024 is a leap year, so the last day of February is the 29th (serial 45350).

Example 2: Last day of the previous month

Finding the prior period end

A negative months value goes backward

=EOMONTH(DATE(2024, 1, 15), -1)
Result: 45290
One month before is December 2023, whose last day is Dec 31 (serial 45290).

How EOMONTH Works

EOMONTH first moves start_date by the supplied number of months, then returns the serial number of the final day of that resulting month. It is often combined with DATE to build the first day of a month (e.g. EOMONTH(...)-DAY(...)+1).

1
Enter the start date
Provide a date serial or DATE(...) expression.
2
Enter the month offset
Use a positive or negative integer for months.
3
Format as a date
The result is a serial; apply a date format to view it.

Important Notes & Limitations

  • The months argument is truncated to an integer (1.9 becomes 1).

  • Negative months go backward in time.

  • The result is a serial number and needs a date format to be readable.

Common Errors & Fixes

#VALUE!The start_date is not a valid date serial.

Fix: Pass a real date value or DATE(...) expression.

Unexpected month shownMisreading the offset sign.

Fix: Remember positive months move forward, negative move backward.

Download Practice File

Practice EOMONTH with Real Data

Download a sample CSV file with pre-populated data and practice exercises for the EOMONTH function. Works in both Excel and Google Sheets.

Works in Google SheetsCompatible with ExcelIncludes exercises

File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps

Frequently Asked Questions

How do I get the first day of the month?
Use EOMONTH(date,-1)+1 for the prior month-end plus one, or DATE(YEAR(date),MONTH(date),1).
What does a 0 month offset return?
The last day of the same month as start_date.
Is the leap day handled automatically?
Yes, EOMONTH returns Feb 29 in leap years and Feb 28 otherwise.