# How do I compare 2 dates with if concept

November 18, 2011 at 06:38:25
Specs: Windows XP
 We are trying to figure out when to escalate a late entry to our database. Example A1 B1Evidence Date Due Evidence Accepted Date 10/11/11 10/09/11now from the evidence accepted date we have 10 days to review and submit our report. In this scenario we would be over by 8 days on our due date so what I am trying to do is find a formula similar to this =IF((B1+10)<=A1, "TRUE","FALSE")but it doesn't work... Please help! Thank you :)

See More: How do I compare 2 dates with if concept

#1
November 18, 2011 at 07:26:15
 What do you mean by "it doesn't work"?Using your example, B1+10 = 10/19/2011Since 10/19/2011 is not <= 10/11/2011, the formula returns FALSE, which is what I would expect it to do.So, what isn't working?Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

Report •

#2
November 18, 2011 at 10:46:17
 Every time I enter =IF((B1+10)<=A1, "TRUE","FALSE") it always results as TRUE although I change the dates to change the outcome to FALSE and it always results TRUE I'm fresh out of Ideas on how to make it function properly.

Report •

#3
November 18, 2011 at 11:47:06
 It works fine for me:Using todays date in column Aand your formula of:=IF((B1+10)<=A1, "TRUE","FALSE")in column C``` A B C 1) 11/18/2011 11/4/2011 TRUE 2) 11/18/2011 11/5/2011 TRUE 3) 11/18/2011 11/6/2011 TRUE 4) 11/18/2011 11/7/2011 TRUE 5) 11/18/2011 11/8/2011 TRUE 6) 11/18/2011 11/9/2011 FALSE 7) 11/18/2011 11/10/2011 FALSE 8) 11/18/2011 11/11/2011 FALSE 9) 11/18/2011 11/12/2011 FALSE 10) 11/18/2011 11/13/2011 FALSE ```MIKEhttp://www.skeptic.com/

Report •

Related Solutions

#4
November 18, 2011 at 12:11:50
 My guess is that the dates aren't being recognized as dates by Excel.How did the dates get into the cells? Downloaded perhaps?BTW, you should be aware that TRUE and "TRUE" are not the same thing.TRUE is recognized as a logical TRUE (1) by Excel while "TRUE" (with the quotes) is recognized as the text string TRUE. The same holds for FALSE and "FALSE".This may not make a difference depending on what you are doing with the "TRUE" and "FALSE" values, but I just wanted you to be aware that the quotes tell Excel that whatever is between them is Text, even if it looks like a number or a logical value.Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

Report •

#5
November 22, 2011 at 11:50:37
 Yes the Dates were downloaded from another program and they were imputed as General and not Date... I changed the dates from General to Date and the IF concept still does not work... Thank you guys for helping out I really appreciate it.

Report •

#6
November 22, 2011 at 12:23:57
 Post a sample of your spreadsheet with column heading.READ THIS FIRST:http://www.computing.net/howtos/sho...MIKEhttp://www.skeptic.com/

Report •

#7
November 22, 2011 at 15:40:47
 This is known issue with Excel.Dates downloaded from other programs don't always end up be recognized as Dates by Excel, even if you try to change the formatting.You could try this:In other column use the DATEVALUE function to see if it returns a 5 digit number from your "dates".If it does, do an Edit...PasteSpecial...Values on the DATEVALUE cells and then format the 5 digit numbers as Dates.Your IF function should work after that.Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

Report •