Solved

Test to see if date was the last day of month

Posted on 2013-06-12
3
367 Views
Last Modified: 2013-06-12
I need a formula to return a 1 if the date (lets say  A1) was the last day of the month or a 0 if it was not. I have a long list of dates and I just need to pull out the month end dates from each range.
0
Comment
Question by:wilpitz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 500 total points
ID: 39242857
Use this formula:

=IF(DATE(YEAR(A1),MONTH(A1)+1,0)=A1,1,0)

Kevin
0
 

Author Closing Comment

by:wilpitz
ID: 39242865
That did it!
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 39242866
If A1 is the last day of the month then the next day will be the 1st, so you can just test that, i.e.

=IF(DAY(A1+1)=1,1,0)

regards, barry
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question