Search This Blog

Monday 14 January 2013

Get last day of previous month

=EOMONTH(TODAY(), -1)

Use this function to get last day of previous month from today.


EOMONTH Function is only available for Excel 2007 and above

If EOMONTH function is not available, use this:
=DATE(YEAR(TODAY()), MONTH(TODAY()), 0)

The DATE function will return a date value when you enter in the year, month and day as inputs, what is magical about the DATE function is displayed in my example. I used 0 as the last input for day, this automatically returns the last day of the previous month :)

No comments:

Post a Comment