FormulaCraft

How to get the last day of the month in Excel and Google Sheets

Excel & Google Sheets
=EOMONTH(A2,0)

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 your date in A2.
  2. 2In a result cell, enter =EOMONTH(A2,0).
  3. 3The second argument (0) means the current month. Use 1 for next month, -1 for last month.
  4. 4Format the result cell as a date.
  5. 5Combine with DAY to get the number of days in the month: =DAY(EOMONTH(A2,0)).

Tips

Need it for your exact data?

Describe your columns in plain English and get the precise formula for your sheet, with the right Excel or Sheets syntax.

Frequently asked

How do I get the last day of the next month?

Change the offset to 1: =EOMONTH(A2,1). For two months ahead use 2, and so on.

Is there an alternative to EOMONTH?

Yes: =DATE(YEAR(A2),MONTH(A2)+1,0) also returns the last day. Day 0 of any month is the last day of the previous month, making this a useful trick.

Formulas used

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

Last reviewed: