Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with date compare in excel

Status
Not open for further replies.

sap1958

Technical User
Oct 22, 2009
138
US
Sheet1:

cell p2 holds the ID

cell y2 holds the listed start date

cell z2 holds the listed start date from sheet2

cell aa2 holds project start compare



Sheet2:

cell a2 holds the ID

cell e2 holds the start date



I used a =VLOOKUP(p2,Sheet2!$a$2:$e$9999,5,FALSE) to populate the listed start date from sheet2 into sheet1

I now want to do a comparison. In cell aa2 if y2=z2 then print "Match" else "Incorrect". What is happens is that dates that

have a timestamp ( ie 1/6/2008 8:00:00 AM) give me a match if y2=z2. However if y2 has a timestamp and z2 does not I get an Incorrect marker even though y2 and z2 have the same value. How can I correct this issue? Is there a macro or some other procedure I can develop?

 
If it's just the date you wish to comapre and don't care about the time, then use
=INT(=VLOOKUP(p2,Sheet2!$a$2:$e$9999,5,FALSE))

or better still, in cell AA2 =IF(INT(Y2)=INT(Z2),"Match","Incorrect")



Canadian eh! Check out the new social forum Tek-Tips in Canada.
I should live a long time - I eat a lot of preservatives.
 


hi,
However if y2 has a timestamp and z2 does not I get an Incorrect marker even though y2 and z2 have the same value.
Huh? If "y2 has a timestamp and z2 does not," then how can "y2 and z2 have the same value?"

Please read and understand faq68-5827, as that may be part of the issue.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top