+ Reply to Thread
Results 1 to 5 of 5

Nested IF Statements not working

  1. #1
    Registered User
    Join Date
    03-26-2022
    Location
    Queensland, Australia.
    MS-Off Ver
    365
    Posts
    22

    Nested IF Statements not working

    =(IF(D2="Inner",(IF(C2="Antaro",(IF(OR(G2={"MC","MD","MDD"}),$J2-$I2-$S$9
    =(IF(D2="Inner",(IF(C2="Merivobox",(IF(G2="ME",$J2-$I2-$S$10
    =(IF(D2="Inner",(IF(C2="Legrabox",(IF(G1="C",$J2-$I2-$S$11
    =(IF(D2="Inner",(IF(C2="Smooth",(IF(OR(G2={"MD","MDD"}),$J2-$I2-$S$12
    =(IF(D2="Inner",(IF(C2="Dragon",$J2-$I2-$S$13

    Hi, I have been trying to nest the above IF statements unsuccessfully. They (all 5), all work individually, but not when I try to nest them.
    What has been happening is if the first statement is true it works and processes the formula. But if it is false, it ends there without going any further.
    Is there a way to nest these? Or is there a better way to achieve what I am trying to do?

    This was the best nested version.
    =IFERROR(IF(D5="Inner",(IF(C5="Antaro",(IF(OR(G5={"MC","MD","MDD"}),$J5-$I5-$S$9,IF(C5="Merivobox",(IF(G5="ME",$J5-$I5-$S$10,IF(C5="Legrabox",(IF(G4="C",$J5-$I5-$S$11,IF(C5="Smooth",(IF(OR(G5={"MD","MDD"}),$J5-$I5-$S$12,IF(C5="Dragon",$J5-$I5-$S$13))))))))))))))),0)

    Thanks.
    Last edited by Kenny_K; 06-11-2024 at 11:53 PM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2407 (Windows 11 23H2 64-bit)
    Posts
    84,036

    Re: Nested IF Statements not working

    Try:

    Please Login or Register  to view this content.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    03-26-2022
    Location
    Queensland, Australia.
    MS-Off Ver
    365
    Posts
    22

    Re: Nested IF Statements not working

    Thanks AliGW, However it didn't work. There is a fault in the code.

    =IF(AND(D2="Inner",C2="Antaro",OR(G2={"MC","MD","MDD"})),$J2-$I2-$S$9,
    IF(AND(D2="Inner",C2="Merivobox",G2="ME"),$J2-$I2-$S$10,
    IF(AND(D2="Inner",C2="Legrabox",G1="C"),$J2-$I2-$S$11,
    IF(AND(D2="Inner",C2="Smooth",OR(G2={"MD","MDD"}),)$J2-$I2-$S$12,
    IF(AND(D2="Inner",C2="Dragon"),$J2-$I2-$S$13,"")))))

    Excel highlighted $J$2 in the second last line. Which in itself is not wrong. But I tried removing the Bracket in front of it which I thought looked out of place, and still no good.

  4. #4
    Registered User
    Join Date
    03-26-2022
    Location
    Queensland, Australia.
    MS-Off Ver
    365
    Posts
    22

    Re: Nested IF Statements not working

    AliGW, I just moved the comma one place to the right, looks like it may be ok now. Let me check it and come back to you.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2407 (Windows 11 23H2 64-bit)
    Posts
    84,036

    Re: Nested IF Statements not working

    It was a typo - your correction is correct.

    Glad to have helped.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED. You can also access the SOLVED tag by editing the opening post and choosing SOLVED from the drop-down to the left of the title box.

    Also, if you have not already done so, remember that you can reward anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Nested If statements with data validation not working
    By bjnockle in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-21-2023, 08:23 PM
  2. [SOLVED] VLOOKUP not working when substituted with nested IF statements.
    By Atwech in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-27-2023, 10:32 AM
  3. [SOLVED] Nested IF (with AND) statements not working
    By TrojanHorse8806 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-13-2021, 12:38 PM
  4. [SOLVED] Nested IF Statements not working
    By VisionSmart in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-09-2017, 12:16 AM
  5. [SOLVED] CPearson's "Assign Name" Workaround Solution for Too Many Nested IF Statements Not Working
    By justinbelkin in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-05-2013, 05:13 PM
  6. Replies: 2
    Last Post: 01-11-2010, 07:37 AM
  7. Replies: 12
    Last Post: 05-15-2009, 08:38 AM

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