• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 204
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

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