To calculate the end of month date in Excel, use the EOMONTH function: =EOMONTH(A1,0), where A1 holds your starting date. The zero means "same month." That single formula returns the last calendar day of the month, correctly handling 30-day months, 31-day months and February in leap years. You need a valid Excel date in a cell first, and EOMONTH requires the Analysis ToolPak on very old versions (Excel 2003 and earlier) but is built in from Excel 2007 onward, including Excel for Microsoft 365, Excel for Mac, and Excel for the web. If EOMONTH returns a serial number instead of a date, the cell is simply formatted as General rather than as a Date.
What You'll Need
- Excel 2007 or later (Windows, Mac, or Excel for the web). Older versions need the Analysis ToolPak add-in enabled under Tools > Add-Ins.
- A cell containing a real date, typed as a date (for example 3/15/2026) or produced by a formula such as
=TODAY()or=DATE(2026,3,15). Text that merely looks like a date will not work. - A basic understanding of cell references, so you can copy the formula down a column.
Note that menu labels and function availability can differ slightly by version and region, but the function syntax below is the same across all modern Excel builds.
Step-by-Step
- Put a real date in a cell. Click cell A2 and type
3/15/2026, then press Enter. Check that the value is right-aligned by default; right-aligned dates are recognized as dates, while left-aligned entries may be text. You can also use=DATE(2026,3,15)to build a date from year, month and day with no regional ambiguity. - Click the cell where you want the result, for example B2, next to your starting date.
- Type the formula:
=EOMONTH(A2,0)and press Enter. EOMONTH takes two arguments: the start date and the number of months to move forward (or backward, if negative) before finding the month's end. Zero keeps the same month. - Confirm the result. With 3/15/2026 in A2, the formula returns 3/31/2026. The day you started on is irrelevant; EOMONTH always lands on the final day of the target month.
- Fix the formatting if you see a number like 46112. That is an Excel serial date, not an error. Select the result cell, then use the Home tab > Number Format dropdown and choose Short Date or Long Date. On Mac the same dropdown sits in the Home ribbon. Alternatively press Ctrl+1 (Cmd+1 on Mac) and pick Date in the Format Cells dialog.
- Copy the formula down. Drag the fill handle from the corner of B2 down the column, or copy B2 and paste into the cells below. Excel adjusts A2 to A3, A4 and so on automatically.
- Get the end of next month by changing the second argument to 1:
=EOMONTH(A2,1). Use -1 for the previous month's end, and 12 for the same date one year ahead. - Build the first day of the following month when you need it, for example for billing periods:
=EOMONTH(A2,0)+1. This returns 4/1/2026 for March. Add 1 to the end-of-month date because Excel stores dates as whole-day serial numbers. - Calculate the current month's end without a source cell using
=EOMONTH(TODAY(),0). This updates every time the workbook recalculates, so it always shows the last day of the current month. - Count the days remaining in a month if needed with
=EOMONTH(A2,0)-A2, formatted as a plain number. This is useful for deadline or pro-rata calculations.
Common Mistakes
- Leaving out the second argument.
=EOMONTH(A2)returns an error. Excel needs both the date and the month offset, even when the offset is 0. - Typing dates as text. If the source cell contains "15 March 2026" as text from a CSV import or another system, EOMONTH returns #VALUE!. The cell should be right-aligned and behave like a date; convert it with Data > Text to Columns or DateValue.
- Confusing EOMONTH with EOMONTH+1. EOMONTH gives the last day itself, not the first day of the next month. If a report keeps showing the 31st when you expected the 1st, subtract one from the offset or add a day.
- Misreading the serial number. A result like 46112 is correct data with the wrong format, not a broken formula. Apply a date format.
- Negative offsets pointing at the wrong month. Using -1 when you meant 1 shifts the result to the previous month, so check the sign before copying down.
- Hard-coding month lengths. Writing =DATE(2026,2,28) works until you hit a leap year. EOMONTH handles February automatically.
Tips
- Use EOMONTH as the backbone of a month range: the period starts at
=EOMONTH(start,0)+1and ends at=EOMONTH(next,0). - Combine it with SUMIFS or COUNTIFS to total transactions between two end-of-month boundaries.
- Wrap it in TEXT to control display:
=TEXT(EOMONTH(A2,0),"mmmm dd, yyyy")shows a friendly label without changing the underlying date. - Apply a date number format to the whole column before filling, so copied results appear as dates immediately.
- Use
=EOMONTH(A2,0)-EOMONTH(A2,-1)to count how many days the month contains, which makes leap-year checks trivial.
Troubleshooting
- #NAME? error: Excel does not recognize the function. On Excel 2003 or earlier this happens until you enable the Analysis ToolPak; on modern versions it usually means a typo such as EOMONTHS or a space inside the name.
- #VALUE! error: One argument is text rather than a date or number. Check that the date cell is a true date and that the offset cell contains a numeric value with no stray spaces.
- #NUM! error: The resulting date falls outside the range Excel can handle, typically when the offset pushes it before 1900 or beyond the year 9999. Reduce the offset.
- Formula shows as text instead of calculating: The cell may be formatted as Text before you typed. Format it as General, delete the entry and retype it.
- Results look off by one day: Check the source date's actual value using a General format; the cell may contain a time component that is being carried into the calculation. Use INT(A2) to strip the time.
- Everything fails after copying from another file: External references may have broken. Recreate the formula with local references.
Frequently Asked Questions
Does EOMONTH account for leap years?
Yes. In a leap year, =EOMONTH("1/15/2028",0) returns 2/29/2028. Excel's date engine knows which Februaries have 29 days.
How do I get the first day of the month instead?
Use =DATE(YEAR(A2),MONTH(A2),1), or use =EOMONTH(A2,-1)+1. Both give the month's first day.
Why does my result show five digits?
Excel stores dates as serial numbers. Your cell is formatted as General or Number, so apply a Date format via the Home tab or Ctrl+1.
Can I use EOMONTH with a cell that contains TODAY()?
Yes. =EOMONTH(TODAY(),0) returns the current month's last day and refreshes on each recalculation.
Does EOMONTH work in Google Sheets and LibreOffice?
Yes, both support the same function and arguments, so formulas usually transfer without changes.
Can I get the end of a quarter?
Yes, indirectly. Nested logic is needed to find the quarter's final month, but =EOMONTH(A2,2) gives the end of the third month after the start, which aligns with quarter boundaries when the start is in the first month of a quarter.