How-To-Get-The-Last-Day-Of-The-Month How to Get the Last Day of the Month

Example

=DAY(EOMONTH(B3,0))

Generic Formula

=DAY(EOMONTH(Date,0))

Date – This is the date for which you want to return the last day of the month.

What It Does

This formula will return the last day of the month from the date selected.

How It Works

EOMONTH(Date,N) will return the last date in the month that is N number of months before or after the Date. If N is 0 then this will be the last date in the same month as the Date. In our example EOMONTH(“2017-07-27”,0) results in 2017-07-31 because the 31st is the last day in the month in July. We then use the DAY function to return the numerical value of the last day of the month. In our example DAY(“2017-07-31”) results in 31.