The end of last month formula in Excel is =EOMONTH(TODAY(),-1). It returns the last day of the previous month as a real date, so you can format it however you like. EOMONTH stands for "end of month": the first argument is a date, and the second argument is a number of months to add or subtract. Use -1 to go back one month, 0 for the current month, and 1 for the next month. The result is a genuine date value, not text, which means functions like DAY, TEXT and date maths keep working on it.

What You'll Need

  • Any modern Excel version (Microsoft 365, Excel 2019 or later, Excel for Mac, or Excel for the web). EOMONTH is a built-in function and needs no add-in.
  • A cell where the formula will live, ideally formatted as a date.
  • Optionally, a cell containing a reference date, if you want the result tied to a specific month rather than today.

Step-by-Step

  1. Pick your target cell. Click an empty cell, for example A1, and make sure it is not formatted as Text. If a cell is pre-set to Text, Excel will show the formula as a string instead of calculating it. Check via the Home tab's number format dropdown; it should say something other than Text.
  2. Type the core formula. Enter =EOMONTH(TODAY(),-1) and press Enter. TODAY() supplies the current date, and -1 moves back one month. Excel then snaps to the last day of that month. For example, if today is 15 December 2026, the result is 30 November 2026, whatever the day of the month happens to be.
  3. Point it at a reference date instead, if you prefer. Replace TODAY() with a cell reference: =EOMONTH(A2,-1), where A2 holds the date you care about. This is the better choice for reports, because the result stays fixed and does not roll forward every time the workbook recalculates.
  4. Format the result as a date. The cell may show a five-digit serial number such as 46346. That is normal: Excel stores dates as serial numbers and only the formatting makes them look like dates. Select the cell, go to Home > Number Format, and choose Short Date or Long Date. You can also right-click > Format Cells > Date. Menu labels can differ slightly by version, device or region, so look for the equivalent control in your copy.
  5. Extract just the day number, if that is what you need. Wrap the formula in DAY: =DAY(EOMONTH(TODAY(),-1)) returns 30 or 31 as a plain number. This is useful when you want to show "the month had 30 days" rather than a date.
  6. Build a friendly text label. Use TEXT to control the appearance: =TEXT(EOMONTH(TODAY(),-1),"dd mmm yyyy") gives something like "30 Nov 2026". Remember this produces text, so you cannot do date arithmetic on the result.
  7. Get the first day of this month from the same idea. =EOMONTH(TODAY(),-1)+1 gives the day after the end of last month, which is the first day of the current month. Similarly, =EOMONTH(TODAY(),-2)+1 gives the first day of last month. Together these two formulas define last month's full date range for filtering or SUMIFS criteria.
  8. Use it inside a report calculation. For a total of everything dated on or before last month's end: =SUMIFS(B:B,A:A,"<="&EOMONTH(TODAY(),-1)), assuming dates are in column A and amounts in column B. The comparison operator is joined to the date with an ampersand, which is how SUMIFS accepts a dynamic date criterion.
  9. Check the result against a known date. Temporarily replace TODAY() with a hard-coded date such as DATE(2026,3,15) and confirm the formula returns 28 February 2026. Leap years and month lengths are handled automatically, which is exactly why EOMONTH beats manual day counting.

Common Mistakes

Typing the formula into a text-formatted cell. The most frequent complaint is that the formula appears as text. The fix is to change the cell format to General, then re-enter the formula by pressing F2 and Enter, or by retyping it. Just changing the format alone will not recalculate an already-typed string.

Reading the serial number as an error. A result like 46346 is correct. Format the cell as a date.

Using -1 when you meant the current month. EOMONTH(TODAY(),0) is the end of the current month; -1 is the end of last month; -2 the month before that. Off-by-one errors here are the second most common problem.

Expecting the formula to freeze. TODAY() recalculates every time the workbook opens or recalculates. A report labelled "end of last month" built on TODAY() will change on the first day of the next month. For archived reports, paste the result as a value: copy the cell, then Paste Special > Values. Note that this replaces the formula, so keep a copy if you still need it live.

Getting #NAME?. This usually means the function name is mistyped, a non-English locale spells it differently, or the formula was entered with smart quotes. Retype the name in plain letters.

Tips

  • Name a cell such as AsOfDate and use =EOMONTH(AsOfDate,-1) everywhere. One change then updates the whole report.
  • Pair it with EDATE when you need the same day number in a prior month, and with EOMONTH when you specifically need month ends.
  • For a fiscal calendar with a non-standard year end, EOMONTH alone is not enough; you need an offset or a lookup table of period ends.
  • Keep an eye on regional date formats: the same formula can display as 11/30/2026 or 30/11/2026 depending on your system settings, though the underlying value is identical.
  • Use conditional formatting or a simple IF to flag when a due date falls after EOMONTH(TODAY(),0), which is a common way to highlight overdue items.

Troubleshooting

The cell shows the formula text. Change the format to General and re-enter the formula. If the cell was imported from a CSV, leading apostrophes may be the cause; remove them.

You get #VALUE!. The date argument is not a real date. Check whether the reference cell contains text like "30/11/2026" stored as a string, or a blank cell. Convert it to a real date or use DATEVALUE.

You get a wrong day, such as the 1st instead of the last day. Confirm the second argument is -1 and not 1 or 0. Also confirm the reference cell is not holding the first day of a month when you expect the previous month.

The result is off by a month at year boundaries. This is normally an argument error, not a function bug: EOMONTH handles January and December correctly. Test with DATE(2026,1,10) and expect 31 December 2025.

A #NUM! error appears. The result date falls outside Excel's supported date range, which happens when the starting date is extremely early or the month offset is very large.

Nothing updates when you press Enter. Calculation may be set to Manual. Check Formulas > Calculation Options and set it to Automatic.

Frequently Asked Questions

Does EOMONTH work in older Excel versions?

Yes, it has been available for a long time in desktop Excel. If a very old file shows #NAME?, the function may have been saved without the analysis toolpak support that older versions required; opening it in a current version resolves this.

Can I get the end of last month without EOMONTH?

Yes: =DATE(YEAR(TODAY()),MONTH(TODAY()),0) returns the last day of the previous month, because day 0 of a month means the day before its first day. It is a useful alternative if you prefer to avoid EOMONTH.

Why does my result change every month?

Because TODAY() is volatile and updates with the system clock. Use a fixed reference cell or paste the result as a value for a permanent record.

How do I get the last day of last month in Google Sheets?

The same formula works: =EOMONTH(TODAY(),-1). The function name and syntax are identical.

Can I show the month name instead of a full date?

Yes, wrap the result in TEXT with a format such as "mmmm yyyy" to display something like "November 2026".