Solved Excel if then statements using dates

April 18, 2013 at 10:56:15
Specs: Windows XP
I am working with an Excel file and I have today's date autopopulating in cell C1 using the NOW function. In cell b12 I enter the date of an instance, for example 4/15/2013, then in C12 I am using the function of IF(B12="","",SUM(B12+30)) to give me 30 days from the date. In cell H12 I am trying to have that cell autopopulate if the date in C12 is older than today's date in C1. I have written the formula the way I feel it should work, but it is not working yet. Here is what I have =IF(C12="","",IF(C12<C2,"","X")).

Once I get that working there is another formula for me to add where it turns the line red if there is an X in H12.

It seems like a lot of stipulations and connections and I know if one thing is off, then more than likely even more will not work.

Thank you


See More: Excel if then statements using dates

Report •

#1
April 18, 2013 at 12:45:16
I don't see where you are using C2 for anything, so I can't answer any question related to IF(C12<C2,"","X").

BTW, if you are only dealing with Dates, why not use =TODAY() instead of = NOW()?

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

#2
April 18, 2013 at 12:49:35
C2 is the date that the file is in use. I changed it to TODAY(). I want to be able for the date in C12 to be judged against the date the file is open and then have it act accordingly. It is a file I use to track incidents andif they are over 30 days old I need them marked and I am trying to use the formulas available to make it easier.

Report •

#3
April 18, 2013 at 13:19:12
✔ Best Answer
You never mentioned C2 in your OP so I didn't know what it was being used for. You referred to C1 twice, but then never used C1 in any of your formulas. Thus my confusion.

Anyway, here's what I tried:

I put =TODAY() in C2. It returned 4/18/2013.

I put =IF(B12="","",SUM(B12+30)) in C12. It returned "" because B12 is empty.

I put =IF(C12="","",IF(C12<C2,"","X")) in H12. It returned "" because B12 is empty.

I then entered 3/15/2013 in B12:

C12 now displays 4/14/2013 and H12 still displays nothing because C12<C2.

I then entered 4/15/2013 in B12:

C12 now displays 5/15/2013 and H12 now displays X because C12>C2.

Isn't that what you want?

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •
Related Solutions


Ask Question