Solved

# Last months date

Posted on 2011-05-13
163 Views
Hi,

I have some formula which returns me the 1st day of the month (-1) based on todays date

So today, i would get 01/04/2011 based on 13/05/2011

I want to amend that so i get the last calender day of the month, so today i would get 30/04/2011

My formula is =DAY(DATE(YEAR(B2),MONTH(B2)+1,1)-1)

where B2 = Today()

Thanks
Seamus
0
Question by:Seamus2626

LVL 81

Accepted Solution

=DAY(DATE(YEAR(B2),MONTH(B2),0))

Kevin
0

LVL 81

Expert Comment

Or, if you want the whole date value for the last day of the month:

=DATE(YEAR(B2),MONTH(B2),0)

Kevin
0

Author Closing Comment

Thanks Kevin!

Seamus
0

## Featured Post

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directiâ€¦
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.