# 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.

## John MacDougall

John is a Microsoft MVP and freelance consultant and trainer specializing in Excel, Power BI, Power Automate, Power Apps and SharePoint. You can find other interesting articles from John on his blog or YouTube channel.

## Related Articles

#### How To Conditionally Concatenate A Range

This formula will conditionally concatenate a range based on a criteria in another range.

#### How To Solve a Quadratic Equation

These formulas will give the solutions to a quadratic equation.

#### How To Select A Random Item From A List

This formula will return a random selection from a given list with each item in the list having an equal probability of being selected.