Skip to content

How to find the last day of a month

Excel & Google Sheets
=TEXT(EOMONTH(DATE(A2,B2,C2),0),"yyyy-mm-dd")

Verified example

Computed by a real spreadsheet engine on the sample data below.

YearMonthDay
2024215

=TEXT(EOMONTH(DATE(A2,B2,C2),0),"yyyy-mm-dd")2024-02-29

Both expressions are checked against an independently calculated expected result in HyperFormula. This is a sample execution check, not native Excel or Google Sheets certification.

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1Enter a valid numeric year, month and day in A2:C2.
  2. 2DATE constructs the input date without relying on text-date parsing.
  3. 3EOMONTH with offset 0 finds the end of that same month.
  4. 4Remove TEXT and format the cell as Date if later formulas need a numeric date rather than the displayed text.

Tips

Working on a sheet you inherited? Run the Auditor on the whole file first — it flags every #REF!, #N/A, broken column pattern, and inconsistent formula in seconds, free, no signup.

Frequently asked

Does this handle leap years?

Yes. February 2024 ends on the 29th; February 2025 ends on the 28th.

Why use EOMONTH instead of adding 30 days?

Months have different lengths. Adding 30 does not reliably reach month end.

Sources and compatibility

Reviewed 2026-09-16

Formulas used

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: