The fastest way to get the last day of a month in Excel is the EOMONTH function. Type =EOMONTH(A1,0) where A1 holds any date in the month you care about, and Excel returns the final day of that month as a real date. To find the last day of the following month, use =EOMONTH(A1,1); for the previous month's end, use =EOMONTH(A1,-1). That is the whole formula. Everything below explains how to enter it, format it, apply it in bulk, and fix the handful of errors people run into. Note that Excel menu names and ribbon labels can differ slightly by version, platform and region, but function names and syntax are the same on Windows, Mac, Excel for the web and Google Sheets.

What You'll Need

  • A version of Excel that supports EOMONTH (Excel 2007 or later, Excel for Mac, Excel for the web, or Excel mobile). Older files saved with an .xls extension may not recognise it.
  • A cell containing a date, or a date typed directly into the formula, so there is something for the function to work from.
  • A blank cell for the result. Plan a column if you want to apply it to a whole list.

Step-by-Step

  1. Put a date in a cell. Click cell A1 and type something like 15/03/2025 or, if your system uses month-first dates, 3/15/2025. Press Enter. The cell should right-align automatically; that is Excel's sign it recognised a real date rather than text.
  2. Click the result cell. Select B1 and type the equals sign to begin a formula.
  3. Enter the EOMONTH function. Type =EOMONTH(A1,0) and press Enter. The 0 means "zero months from the date in A1," so you get the end of the same month. For 15 March 2025 the result is 31/03/2025.
  4. Shift the month forward or back. Change the second argument. =EOMONTH(A1,1) gives the end of the next month (30 April 2025 in this example), and =EOMONTH(A1,-1) gives the end of the previous month (28 February 2025). Use 12 to jump to the same month next year, -12 to go back a year.
  5. Check the formatting. If the answer appears as a serial number such as 45747, the cell is formatted as General. Right-click the cell, choose Format Cells, pick Date, and select a format. On the Home tab, the number format dropdown does the same job faster.
  6. Fill it down a list. Put the cursor on the fill handle in the bottom-right corner of B1 until it turns into a small cross, then drag down, or double-click it to fill to the end of the adjacent data. Each row's formula points at its own date, so B2 uses A2 and so on. If you would rather not reference a cell at all, type the date inside the formula: =EOMONTH("15/03/2025",0). Dates entered this way must be in a format Excel recognises, so the safest option is =EOMONTH(DATE(2025,3,15),0).
  7. Make it a readable text label if needed. To show "31 March 2025" in a report, wrap the result: =TEXT(EOMONTH(A1,0),"d mmmm yyyy"). Be aware the output is now text, so it will not work in later date calculations.

Common Mistakes

  • Dates stored as text. If A1 is left-aligned after typing, Excel treated the entry as text and EOMONTH returns a #VALUE! error. Retype it in your regional date format, or use DATE(year, month, day) to build a genuine date.
  • Wrong second argument. Many people expect 1 to mean "this month" and 0 to mean nothing. It is an offset: 0 is the current month, 1 is next month, -1 is last month.
  • Forgetting to format the result. A bare five-digit number is not a broken formula, just an unformatted date cell.
  • Typing the function as EOMONTH but the file is in an old format. Legacy .xls files and some third-party spreadsheet programmes do not always support it; save a copy as .xlsx or use the DATE workaround below.
  • Assuming EOMONTH ignores the day. It does ignore the day of the month you pass in, which is the point: 1 March and 30 March both return 31 March.

Tips

  • To get the number of days in a month, subtract the first day from the end: =EOMONTH(A1,0)-DATE(YEAR(A1),MONTH(A1),1)+1.
  • No EOMONTH in your spreadsheet tool? Use =DATE(YEAR(A1),MONTH(A1)+1,0). The day zero of the following month is the last day of the current one. Add 1 to the month argument to step forward.
  • To count working days to month end, combine it with NETWORKDAYS: =NETWORKDAYS(TODAY(),EOMONTH(TODAY(),0)).
  • Use EOMONTH inside SUMIFS or COUNTIFS to build monthly totals that always cover the full month, however the source dates are spread out.
  • Keep a helper column of real dates and reference it, rather than typing dates into dozens of formulas. You only fix a date in one place.

Troubleshooting

If you see #NAME?, Excel does not recognise the function name: check for a typo such as EOMONTHS, that the equals sign is present, and that the file format supports it. If you see #VALUE!, the first argument is text or an empty cell; confirm the source cell holds a real date. A #NUM! error usually means the date calculation fell outside Excel's supported date range, so check the year. If the result looks correct but sorts incorrectly, the output is probably text from a TEXT wrapper; remove the wrapper and format the cell instead. If the formula copies down but every row gives the same answer, your references were locked as absolute ($A$1) when you wanted relative (A1). Fix the first cell and refill. If nothing appears at all, the cell may be formatted as Text: change the format to General or Date and re-enter the formula, since simply reformatting will not recalculate it.

Frequently Asked Questions

Does EOMONTH work on dates in a cell and dates typed into the formula?

Both work, but a cell reference is safer. If you type a date into the formula, use DATE(), because a text date may be misread in different regional settings.

What does the second argument mean exactly?

It is the number of months to add or subtract before finding the month end. 0 is the same month, 1 is next month, -1 is last month, and 12 is the same month next year.

How do I get the last day of the current month automatically?

Use =EOMONTH(TODAY(),0). It updates each day based on the system date.

Why does the result show a number like 45747?

Excel stores dates as serial numbers. Format the cell as a Date to display it correctly.

Can I use EOMONTH in Google Sheets?

Yes, Google Sheets supports EOMONTH with the same syntax, including the negative month offset.

How do I get both the first and last day of the month?

The first day is =DATE(YEAR(A1),MONTH(A1),1) and the last is =EOMONTH(A1,0). Keep both in separate columns when building monthly reports.