+ Reply to Thread
Results 1 to 6 of 6

using IF to return text if the reference cell is blank

  1. #1
    Registered User
    Join Date
    02-18-2007
    Posts
    4

    using IF to return text if the reference cell is blank

    I am working on a sheet and I need a particular cell to return text dependant on whether certain conditions are met, thus far I have written this formula:

    =IF(O15<K15,"NO",IF(O15>J15,"NO",IF(O15<J15,"YES",IF(O15=J15,"YES",IF(O15,"","N/A")))))

    The first 4 "IF's" return what they're suppose to however the last IF should return a "N/A" because the cell [referenced] is blank - but it doesn't it returns "NO"

    can anyone help me please

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Try this formula

    =IF(O15="","N/A",IF(OR(O15>J15,O15<K15),"NO",IF(O15<=J15,"Yes","")))

  3. #3
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by mugsy
    I am working on a sheet and I need a particular cell to return text dependant on whether certain conditions are met, thus far I have written this formula:

    =IF(O15<K15,"NO",IF(O15>J15,"NO",IF(O15<J15,"YES",IF(O15=J15,"YES",IF(O15,"","N/A")))))

    The first 4 "IF's" return what they're suppose to however the last IF should return a "N/A" because the cell [referenced] is blank - but it doesn't it returns "NO"

    can anyone help me please
    Hi,

    try

    =IF(O15="","#N/A",IF(OR(O15<K15,O15>J15),"NO","YES"))))

    in your example the first condition tested was true, thus 'NO' was the answer.

    hth
    ---
    Si fractum non sit, noli id reficere.

  4. #4
    Forum Contributor
    Join Date
    06-30-2006
    Posts
    116
    First:

    You should consider using And within the if statement if you are have more than 1 criteria: If (And(a1>1,a1<5), "Good", if(.....

    Thna for ur problem the last if statement you have is missing something: you wrote If(O15,"", "N/A") ...If O15 what?? u mean if O15 = 0 ..If O15 = " " ) do that and it should work fine.

  5. #5
    Registered User
    Join Date
    02-18-2007
    Posts
    4

    that did the trick!

    Quote Originally Posted by Bryan Hessey
    Hi,

    try

    =IF(O15="","#N/A",IF(OR(O15<K15,O15>J15),"NO","YES"))))

    in your example the first condition tested was true, thus 'NO' was the answer.

    hth
    ---
    This formula did exactly what it said on the tin !

    thanks very much

  6. #6
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by mugsy
    This formula did exactly what it said on the tin !

    thanks very much
    good to see that it worked for you, and thanks for the feedback.

    ---

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1