Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    May 2002
    Location
    US
    Posts
    439
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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,
    Brad

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    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. #3
    4 Star Lounger
    Join Date
    May 2002
    Location
    US
    Posts
    439
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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,
    Brad

  4. #4
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: IF Statement help (2003)

    How about:

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

    Steve

  5. #5
    4 Star Lounger
    Join Date
    May 2002
    Location
    US
    Posts
    439
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: IF Statement help (2003)

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


    Brad

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •