+ Reply to Thread
Results 1 to 6 of 6

Adding a conditional IF to other IF statements

  1. #1
    Registered User
    Join Date
    07-25-2010
    Location
    Blue Springs, MO
    MS-Off Ver
    Excel 2007
    Posts
    22

    Thumbs up Adding a conditional IF to other IF statements

    I got help here with this formula in O65:
    Please Login or Register  to view this content.
    It works great as it stands but I've been given another condition and outcome to add and all my attempts end in a variety of errors.
    I would like to have O65 display "NA" if L65 calculates to 0 and C65 <>"ns"

    If it helps, IF L65 does calculate to 0 then N65 will remain blank.

    Thanks for your time and effort!
    Last edited by tradersteve; 10-21-2010 at 02:13 PM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Adding a conditional IF to other IF statements

    Quote Originally Posted by tradersteve
    IF L65 does calculate to 0 then N65 will remain blank.
    In which case wouldn't you just change the "" to "NA" ?

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor
    Join Date
    10-17-2010
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013, 2016, 2019, 365
    Posts
    294

    Re: Adding a conditional IF to other IF statements

    To know how to solve this one, you need to get your logic clearly understood. I have interpreted your description as:

    If N65 isn't blank then:
    ((H65+I65+N65)*10)
    otherwise (i.e. N65 is blank)
    if C65 = "ns" then:
    -1
    otherwise (i.e. c65 doesn't equal "ns")
    if L65=0 then
    "NA"
    otherwise
    ""
    I tend to draw little tree diagrams to help me understand the logic when it gets tortuous...
    If the above, then just put the last IF in instead of the "".
    Please Login or Register  to view this content.
    If it's not the above, then we can only help you once we fully understand the logic.

    A couple of other observations.
    Firstly, COUNTA() on one cell - presumably that's just to see if it's blank or not. You can use NOT(ISBLANK(N65)) for the same thing which is longer, but much easier for other people to understand.
    Secondly, do you want the value "NA" or the error #N/A? If the latter, you can put the function NA() in your formula and it will generate the error code instead of text.

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Adding a conditional IF to other IF statements

    @outofthehat - if the OP logic is as outlined then there is no need for an additional IF.

    OP states that should L65 be 0 then then N65 will be blank - it thus follows that if the 2nd IF is evaluated L65 can not be 0 - we do not need to test for it again - all we need test is C65 (per post # 2)

  5. #5
    Valued Forum Contributor
    Join Date
    10-17-2010
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013, 2016, 2019, 365
    Posts
    294

    Re: Adding a conditional IF to other IF statements

    Duh. Missed that line! Always listen to the Guru....

  6. #6
    Registered User
    Join Date
    07-25-2010
    Location
    Blue Springs, MO
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Adding a conditional IF to other IF statements

    PROBLEM SOLVED! Thanks to you both for the responses and DonkeyOte your revision is correct given the information I supplied. However I'm afraid I left something out. The reason I was wondering about the ability to add an extra "IF" is that I was trying to avoid the "NA" showing on rows that had no data entered yet. (Can't, as far as I know, hide them with conditional formatting the text because I'm using formula to shade every other line) With both responses pieced together I ended up with:
    Please Login or Register  to view this content.
    Which works perfectly! Thankyou very much!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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