To get the last day of any month in Excel, use the EOMONTH function: =EOMONTH(A1,0) returns the end-of-month date for the date in cell A1, as a proper Excel date you can format or do maths with. Change the second argument to move forward or back by whole months — =EOMONTH(A1,1) gives the last day of next month, =EOMONTH(A1,-1) the last day of the previous month. If you are on a very old workbook that does not recognise EOMONTH, the classic alternative is =DATE(YEAR(A1),MONTH(A1)+1,0), which builds the first day of the following month and then steps back one day by using day zero.

What You'll Need

  • Microsoft Excel on Windows, Mac, or the web, or a spreadsheet app that supports standard date functions (Excel 2007 and later all include EOMONTH, as do Microsoft 365 and Excel for the web).
  • A cell containing a valid date, or a hard-coded date you type directly into the formula.
  • A basic understanding that Excel stores dates as serial numbers, so "end of month" is a date value that can be displayed in different date formats.

Labels and menu wording can differ slightly between Excel versions, platforms and regions, but the function names and syntax used here are the same everywhere EOMONTH is supported.

Step-by-Step

  1. Put a real date in a cell. In cell A1, type a date such as 15/03/2024 (or 3/15/2024 depending on your region), or use a cell that already holds a date. Make sure Excel recognises it as a date rather than text — if it sits on the left edge of the cell without right-alignment, it is probably text. You can check by selecting it: a true date shows a serial number in the formula bar when the cell is formatted as General.
  2. Click an empty cell for the result, for example B1. This is where the end-of-month date will appear.
  3. Type the basic formula. Enter =EOMONTH(A1,0) and press Enter. The zero tells Excel not to shift the month at all: you get the last day of the month that A1 falls in.
  4. Read the result. If A1 is 15 March 2024, B1 returns 31 March 2024. If A1 is 3 February 2024, B1 returns 29 February 2024 — EOMONTH automatically handles leap years, 30-day months and 31-day months.
  5. Shift to other months. Use the second argument as an offset in whole months. =EOMONTH(A1,1) gives the last day of the next month (30 April 2024 in the example). =EOMONTH(A1,-1) gives the last day of the previous month (29 February 2024). Positive moves forward, negative moves back, zero stays put.
  6. Format the result as a date if it appears as a number. The cell may show something like 45382, which is the underlying serial number. Select the cell, open the Home tab, and use the Number Format dropdown to choose Short Date or Long Date. You can also right-click the cell, choose Format Cells, pick Date, and select a format. This step only changes appearance, not the value.
  7. Copy the formula down your column. Drag the fill handle (the small square at the bottom-right of the cell) down, or double-click it if the neighbouring column has data. Each row will compute its own end-of-month date. Relative references adjust automatically.
  8. Optionally build a fresh date. If you must supply a literal date rather than a cell reference, wrap it in DATE: =EOMONTH(DATE(2024,3,15),0). This avoids text-versus-date errors and regional format confusion.

Common Mistakes

Storing the date as text. The most frequent failure is a date that looks right but is actually a text string, often pasted from another system. EOMONTH then returns #VALUE!. Test by pressing F2 and seeing whether the formula bar shows a date or a text entry, or by checking alignment. Fix it by re-entering the date or using Data > Text to Columns to convert the column to real dates.

Confusing the offset direction. People often assume a positive number returns a future month's end when they actually wanted the current one. Remember: zero equals the current month's end, and the offset counts whole calendar months, not days.

Expecting the result to be a month name. EOMONTH returns a full date, not text like "March". If you only want the label, wrap it: =TEXT(EOMONTH(A1,0),"mmmm") produces "March".

Using EOMONTH inside a SUM or COUNTIF with a text criteria. Comparisons like ">"&EOMONTH(...) need the date as a value, not in quotes. Quoting it turns it into text and comparisons fail or return zero.

Forgetting to fill format down. After you apply a date format to one cell, rows below may still show serial numbers. Copy the formatted cell and paste formats, or format the whole range at once.

Tips

Pair EOMONTH with TODAY to get the current month's end without a source date: =EOMONTH(TODAY(),0). For a month's start rather than its end, use =EOMONTH(A1,-1)+1, which steps one day past the previous month's end. If you need the number of days left in the month, subtract today: =EOMONTH(TODAY(),0)-TODAY().

Use EOMONTH when building due-date logic — 30 days after month end becomes =EOMONTH(A1,0)+30, and the standard "last day of next month" billing date is simply =EOMONTH(A1,1). Because EOMONTH returns a true date, it sorts and filters correctly, unlike text labels.

In Excel for the web, EOMONTH works the same as desktop, but check that the result cell is formatted as a date after pasting, since browser formatting sometimes defaults to General. In Google Sheets the function is also called EOMONTH with identical syntax, so formulas transfer between the two.

Troubleshooting

You see #NAME? That means the app did not recognise EOMONTH. Check spelling (all one word, no spaces), and confirm you did not accidentally type a smart quote instead of a straight one. In rare cases, an add-in or very old file format blocks newer functions; saving as .xlsx usually resolves it.

You see #VALUE! The source cell is text, empty in an unexpected way, or you passed text as the offset. Verify the source is a real date and the second argument is a number, not "0" in quotes.

You see #NUM! The offset is extreme or the resulting date falls outside Excel's supported date range. Keep offsets within sensible month limits.

The result shows a five-digit number. This is not an error — it is the serial value. Apply a date format as in Step 6.

The date is off by one day. Check whether your source cell was typed in a different date format than your system expects (day/month versus month/day). Excel may have reinterpreted it. Re-enter it using your regional format, or supply it through DATE.

The formula copies wrong. If you copied the formula and all rows show the same month, you probably used absolute references ($A$1). Change to a relative reference like A1 so each row points to its own date.

Frequently Asked Questions

Why does EOMONTH sometimes not appear when I start typing?

Autocomplete should list it once you type =EO. If it does not, the function may be unavailable in that file's compatibility mode or the workbook is restricted. Saving as a modern .xlsx file and reopening usually restores it.

How do I get the last day of a month without EOMONTH?

Use =DATE(YEAR(A1),MONTH(A1)+1,0). Day zero of the following month resolves to the last day of the month you want, and leap years are handled the same way.

Can EOMONTH return the last working day of the month?

Not directly. Combine it with WORKDAY: =WORKDAY(EOMONTH(A1,0)+1,-1) returns the last business day, skipping weekends.

Does EOMONTH work in Google Sheets and LibreOffice?

Yes, both support the same EOMONTH syntax with a start date and month offset, so formulas transfer between them.

Can I use EOMONTH with a date inside the formula itself?

Yes, but wrap it in DATE to be safe: =EOMONTH(DATE(2024,3,15),0). Typed directly, a date string can be misread depending on regional settings.

Why is my result a different month than expected?

Check the offset sign and your source date's interpretation. A positive offset moves forward, and an ambiguous typed date may have been read as the wrong day or month. Supply the date with DATE to remove ambiguity.