# Thread: IF Statement help (2003)

1. ## IF Statement help (2003)

greetings!

Well, I cannot figure this one out. Seems easy enough.
The Cells G4 and I4 contain dates.

What I expected the formula to do is: Check I4, if it is blank, then results for cell is Blank else calculate number of days = today - g4. OR if I4 is greater than 0 then I4-G4.

I am betting I need the "OR", but Not sure where....

=IF(I4="","",TODAY()-G4,IF(I4>0,I4-G4))

thanks,

2. ## Re: IF Statement help (2003)

If I4 contains a date, it is always greater than 0, so it's not clear what you mean by this condition. Did you mean "if I4 is greater than today"?

Does this do what you want?

=IF(OR(ISBLANK(G4),ISBLANK(I4)),"",MAX(TODAY(),I4)-G4)

If MAX doesn't return the desired result, try MIN instead. If that doesn't work either, you'll have to explain more clearly.

3. ## Re: IF Statement help (2003)

Hans,

Using the MIN worked. Guess I should have gone a little deeper with the explaination.

the Cell G4 and I4 "Should " contain Dates. Thus the need to check for blank etc...

basically, I am counting the days the item is "open", once G4 is filled in with a date, the calc should stop incrementing and only calc the difference betweein G4 and I4.

Thanks,

4. ## Re: IF Statement help (2003)

=IF(I4="","",IF(I4>0,I4-G4,TODAY()-G4))

Steve

5. ## Re: IF Statement help (2003)

Steve,
I will try that one as well...