[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 203
  • Last Modified:

Last months date

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
Seamus2626
Asked:
Seamus2626
  • 2
1 Solution
 
zorvek (Kevin Jones)ConsultantCommented:
=DAY(DATE(YEAR(B2),MONTH(B2),0))

Kevin
0
 
zorvek (Kevin Jones)ConsultantCommented:
Or, if you want the whole date value for the last day of the month:

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

Kevin
0
 
Seamus2626Author Commented:
Thanks Kevin!

Seamus
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now