The EOMONTH function in Excel returns the last day of the month that is a specified number of months before or after a start date. It is ideal for calculating billing cycles, due dates, or month-end reporting without manual date adjustments. No add-ins or special setup are required—just ensure your dates are valid Excel dates.
What You'll Need
- Microsoft Excel (any modern version: 2010, 2013, 2016, 2019, 2021, or Microsoft 365)
- A cell containing a valid date (e.g., 15-Mar-2024), or a reference to such a cell
- Understanding that Excel stores dates as sequential serial numbers (e.g., 1-Jan-1900 = 1)
Step-by-Step
- Prepare your data: Ensure the starting date is entered correctly as a true Excel date—not text. For example, type
3/15/2024in cell A2. If Excel displays a number like 45000 instead of a date, right-click the cell > Format Cells > Date to confirm proper formatting. - Enter the EOMONTH formula: In the target cell (e.g., B2), type
=EOMONTH(A2, 0). This returns the last day of the month containing the date in A2. Press Enter. - Use a positive offset for future months: To get the last day of the month three months after the start date, change the second argument:
=EOMONTH(A2, 3). For A2 = 15-Mar-2024, this yields 30-Jun-2024. - Use a negative offset for past months: To find the last day of the month two months before the start date, use:
=EOMONTH(A2, -2). For A2 = 15-Mar-2024, this returns 31-Jan-2024. - Combine with other functions for dynamic reports: For example, to calculate the last day of the current month, use
=EOMONTH(TODAY(), 0). To find the last day of the next month, use=EOMONTH(TODAY(), 1). - Format the result as a date: If the result appears as a serial number (e.g., 45157), select the cell, go to Home > Number group > Short Date (or Custom > d-mmm-yyyy for clarity).
Common Mistakes
- Using text instead of real dates: If A2 contains "March 15, 2024" as text, EOMONTH returns #VALUE!. Always verify the cell value by selecting it—Excel’s formula bar must show a date serial number (e.g., 45000), not quotes around a string.
- Incorrect month offset syntax: Typing
=EOMONTH(A2 3)(missing comma) or=EOMONTH(A2, "3")(text instead of number) causes #VALUE! or #NAME? errors. The second argument must be a number or cell reference containing a number. - Assuming EOMONTH returns a time component: EOMONTH always returns the *last second* of the last day of the month (e.g., 11:59:59 PM), but Excel stores it as a whole number (e.g., 45157 = 30-Jun-2024 00:00:00). If you need the *first* day of the next month, use
=EOMONTH(A2, 0)+1. - Ignoring leap years: EOMONTH correctly handles leap years (e.g.,
=EOMONTH(DATE(2024,2,15),0)returns 29-Feb-2024), but manually calculating withDATE(YEAR(A2), MONTH(A2)+1, 0)can be error-prone. Trust EOMONTH for accuracy.
Tips
- Use with EDATE for month-range checks: To get the first day of the current month, use
=EOMONTH(A2, -1)+1. To find the last day of the previous month, use=EOMONTH(A2, -1). - Batch process with fill handle: After entering the formula in B2, drag the small square at the cell’s bottom-right corner down to apply it to rows 3, 4, etc.
- Combine with IF for conditional month-end logic: Example:
=IF(A2returns the month-end date only if the start date is in the past. - Use named ranges for clarity: Select A2, go to Formulas > Define Name > enter "StartDate", then use
=EOMONTH(StartDate, 1)instead of cell references. - Verify results with the DATE function: As a sanity check,
=DATE(YEAR(A2), MONTH(A2)+1, 0)should match=EOMONTH(A2, 0). - Hold Ctrl and click the formula bar to see results: In Excel 365, use
=EOMONTH(A2, {0,1,2})(as an array formula) to return multiple month-ends in adjacent cells.
Troubleshooting
If EOMONTH returns an error or unexpected result, follow these steps in order:
- Check for #NAME? error: This usually means Excel doesn’t recognize the function. Confirm the Analysis ToolPak is *not* required—EOMONTH is built-in since Excel 2007. If you see #NAME?, you likely misspelled the function (e.g., "EOMONTHH") or are using Excel 2003 or earlier. Upgrade to Excel 2007+.
- Fix #VALUE! error: This occurs if either argument is non-numeric. Test with
=ISNUMBER(A2). If FALSE, the date in A2 is text. Convert it using: select the column > Data > Text to Columns > Finish (or use=DATE(YEAR(A2), MONTH(A2), DAY(A2))if the text parses). - Address #NUM! error: Rare, but can happen if the date serial number is negative (dates before 1-Jan-1900) or the offset is extremely large (e.g., beyond year 9999). Ensure your start date is ≥1-Jan-1900 and offsets are reasonable (e.g., between -1200 and +1200).
- Verify unexpected month-end dates: If
=EOMONTH("2/15/2023", 0)returns 28-Feb-2023 (correct) but you expected 29, confirm it’s not a leap year (2024 is, 2023 is not). Use=EOMONTH(DATE(2024,2,15),0)to verify leap-year handling. - Reset date formatting: If the result shows as 45157 instead of a date, right-click the cell > Format Cells > Date > choose a format (e.g., "14-Mar-01").
Frequently Asked Questions
Does EOMONTH work with dates from other countries (e.g., 15/03/2024)?
Yes, but only if Excel’s system locale recognizes the format. In regions using DD/MM/YYYY, typing 15/03/2024 in A2 will store correctly. If Excel converts it to March 15 (US format), use=DATE(2024,3,15) to force the correct date before applying EOMONTH.
Can I use EOMONTH to find the last business day of the month?
Not directly—EOMONTH returns the calendar last day. To get the last *weekday* (Mon–Fri), use=WORKDAY(EOMONTH(A2,0)+1,-1). For example, if EOMONTH returns 30-Jun-2024 (a Sunday), this formula returns 28-Jun-2024 (Friday).
How do I handle leap years with EOMONTH?
EOMONTH automatically accounts for leap years.=EOMONTH(DATE(2024,2,1),0) returns 29-Feb-2024, while =EOMONTH(DATE(2023,2,1),0) returns 28-Feb-2023. No extra logic is needed.
Is EOMONTH available in Excel for Mac or mobile?
Yes—EOMONTH works in Excel for Windows, Mac, and mobile apps (iOS/Android) as long as you use Excel 2007 or newer. In mobile apps, ensure you’re using the full Excel app (not Excel Online’s free tier) for full function support.What if I need the *first* day of the month instead?
Use=EOMONTH(A2,-1)+1. For A2=15-Mar-2024, EOMONTH returns 29-Feb-2024, adding 1 gives 1-Mar-2024—the first day of the current month.
Can EOMONTH return a time (e.g., 11:59 PM)?
No—EOMONTH returns the *date* of the last day at 00:00:00 (midnight). To get the last *second* of the month, add-1/86400 to the result: =EOMONTH(A2,0)+1-1/86400, which yields 30-Jun-2024 23:59:59 for June 2024.