How to Get the Last Day of Any Month in Excel Using the EOMONTH Function
🔍 WiseChecker

How to Get the Last Day of Any Month in Excel Using the EOMONTH Function

You need to calculate deadlines, due dates, or month-end reports in Excel. Manually finding the last day of a month is error-prone, especially for February or leap years. The EOMONTH function solves this by returning the exact end-of-month date for any given start date. This article explains how to use EOMONTH for accurate date calculations.

Key Takeaways: Using EOMONTH in Excel

  • EOMONTH(start_date, months): Returns the serial number for the last day of the month a specified number of months before or after a start date.
  • Format as Short Date: Apply a date format to the cell containing the EOMONTH result to display it as a standard date like 4/30/2024.
  • Use 0 for the current month: Setting the months argument to 0 calculates the last day of the same month as the start date.

What the EOMONTH Function Does

EOMONTH is a date and time function designed for financial and project planning. It calculates the serial number that represents the last calendar day of a month. Excel stores dates as serial numbers, where January 1, 1900, is number 1. EOMONTH works with this system to provide a precise result.

The function requires two pieces of information: a start date and the number of months to move forward or backward. It always returns the final day, whether the month has 28, 30, or 31 days. This eliminates manual errors from counting days or remembering month lengths. You must format the result as a date to see a recognizable day like March 31.

Function Syntax and Arguments

The syntax is EOMONTH(start_date, months). The start_date is the date you begin counting from. It can be a cell reference, a date entered with the DATE function, or a serial number. The months argument is an integer. A positive number moves forward in time, a negative number moves backward, and zero targets the month containing the start_date.

Steps to Use the EOMONTH Function

Follow these steps to calculate month-end dates in your worksheet.

  1. Select the result cell
    Click on the cell where you want the last day of the month to appear.
  2. Type the EOMONTH formula
    Type an equals sign followed by the function name and an opening parenthesis: =EOMONTH(
  3. Enter the start_date argument
    Click on a cell containing a date, or type a date using the DATE function like DATE(2024,5,15). Add a comma.
  4. Enter the months argument
    Type the number of months to offset. Use 0 for the current month, 1 for next month, or -1 for the previous month. Close the formula with a parenthesis: =EOMONTH(A2, 0).
  5. Press Enter to calculate
    Excel will display a serial number, such as 45409, which represents the calculated date.
  6. Apply a date format
    With the result cell selected, go to Home > Number Format dropdown. Choose Short Date or Long Date to display the correct calendar date.

Using EOMONTH with a Dynamic Start Date

You can use other functions as the start_date for more advanced calculations. For example, =EOMONTH(TODAY(), 1) uses today’s date as the start point and returns the last day of next month. The TODAY function updates automatically each day the workbook is opened.

Common Mistakes and Limitations to Avoid

EOMONTH Returns a Number, Not a Date Format

If your result looks like 45409 instead of 4/30/2024, the cell is formatted as General. Excel shows the underlying serial number. You must change the cell’s number format to a date style via Home > Number Format.

#NUM! Error for Invalid Start Date

This error appears if the start_date argument is not a valid Excel date. Check that the referenced cell contains a real date and not text that looks like a date. Use the DATE function to construct dates reliably.

#VALUE! Error with Non-Numeric Months Argument

The months argument must be a whole number. This error occurs if you reference a cell containing text or a decimal. Ensure the argument is an integer like 0, 3, or -2.

EOMONTH vs. Manual Date Calculation

Item EOMONTH Function Manual Calculation
Accuracy for February Automatically accounts for leap years Requires manual check for leap year rules
Formula Complexity Simple two-argument formula Requires nested DATE, DAY, and MONTH functions
Handling Month Offsets Built-in months argument for easy future/past dates Complex arithmetic needed to change years
Error Rate Low, provided arguments are valid dates and numbers High, due to manual day-counting mistakes

You can now use EOMONTH to find month-end dates for reports and schedules. Try combining it with the TODAY function for dynamic due dates that update automatically. For more complex scenarios, nest EOMONTH inside a WORKDAY function to find the last business day of the month.