+ Reply to Thread
Results 1 to 10 of 10

Nested IF AND OR

  1. #1
    Registered User
    Join Date
    07-14-2016
    Location
    Bangalore, India
    MS-Off Ver
    2013
    Posts
    28

    Nested IF AND OR

    Hello,

    I am preparing some document and almost done with it and stuck at the last one.

    I need help with nested IF AND OR statements.

    Please check the attachment for the sample data.

    I want B17 to display the data based on B6,B10,B13 & B16 values & categories assigned in C column.

    For e.g.,
    It should do something like
    B17 = [IF(OR(B6,B10="not realized", B6,B10="partly realized), "TU"
    AND/OR IF(OR(B10,B13="not realized", B10,B13="partly realized), "UV")
    AND/OR IF(OR(B13,B16="not realized", B13,B16="partly realized), "XY")
    AND/OR IF(OR(B16="not realized", B16="partly realized), "WZ")]

    ELSE BLANK

    In this case, with the data entered in the attachment,

    B17 = [IF(OR(B6,B10="not realized", B6,B10="partly realized), "TU"
    AND/OR IF(OR(B10,B13="not realized", B10,B13="partly realized), "UV")
    AND/OR IF(OR(B13,B16="not realized", B13,B16="partly realized), "XY")
    AND/OR IF(OR(B16="not realized", B16="partly realized), "WZ")]

    ELSE BLANK


    ====[ [ (B6 = "not realized" ) = TU], Also [(B10 = "partly realized" ) = TU] == TU ], [ (B10 = "partly realized" ) = TU], Also [(B13 = "not realized" ) = UV] == UV ] , [ (B13 = "not realized" ) = XY], BUT [(B16="realized") = Blank] = XY ], [[(B16 = "realized" ) =Blank]=blank]
    THUS B17 = TU, UV, XY

    Please let me know in case of any clarifications.

    Regards,
    Anshul
    Attached Files Attached Files
    Last edited by anshul1719; 07-15-2016 at 08:49 AM.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,824

    Re: Nested IF AND OR

    TRY

    =IF(OR($B$6="not realized",$B$10="not realized",$B$6="partly realized",$B$10="partly realized"),"TU",IF(OR($B$10="not realized",$B$13="not realized",$B$10="partly realized",$B$13="partly realized"),"UV",IF(OR($B$13="not realized",$B$16="not realized",$B$13="partly realized",$B$16="partly realized"),"XY",IF(OR($B$16="not realized",$B$16="partly realized"),"WZ",""))))
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    07-14-2016
    Location
    Bangalore, India
    MS-Off Ver
    2013
    Posts
    28

    Re: Nested IF AND OR

    It doesn't work.

    What this is doing is only
    B17=IF(OR($B$6="not realized",$B$10="not realized",$B$6="partly realized",$B$10="partly realized"),"TU","")

    But what is expected is -
    B17=[IF(OR($B$6="not realized",$B$10="not realized",$B$6="partly realized",$B$10="partly realized"),"TU","")]+[IF(OR($B$10="not realized",$B$13="not realized",$B$10="partly realized",$B$13="partly realized"),"UV","")]+[IF(OR($B$13="not realized",$B$16="not realized",$B$13="partly realized",$B$16="partly realized"),"XY","")]+[IF(OR($B$16="not realized",$B$16="partly realized"),"WZ",""))))

    i.e. B17 = TU, UV, XY

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,695

    Re: Nested IF AND OR

    So are you trying to return more than one concatenated answer in the cell?
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    07-14-2016
    Location
    Bangalore, India
    MS-Off Ver
    2013
    Posts
    28

    Re: Nested IF AND OR

    I tried this and it seems to work.
    Tell me if this is correct.

    =CONCATENATE((IF(OR($B$6="not realized",$B$10="not realized",$B$6="partly realized",$B$10="partly realized"),"TU","")), ",",(IF(OR($B$10="not realized",$B$13="not realized",$B$10="partly realized",$B$13="partly realized"),"UV","")),",",(IF(OR($B$13="not realized",$B$16="not realized",$B$13="partly realized",$B$16="partly realized"),"XY","")), ",",(IF(OR($B$16="not realized",$B$16="partly realized"),"WZ")), " ")

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,695

    Re: Nested IF AND OR

    If it is doing what you want, then it must be working!

  7. #7
    Registered User
    Join Date
    07-14-2016
    Location
    Bangalore, India
    MS-Off Ver
    2013
    Posts
    28

    Re: Nested IF AND OR

    It returns "TU, UV, XY, FALSE"
    How can I omit FALSE?

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,695

    Re: Nested IF AND OR

    Try this:

    =CONCATENATE((IF(OR($B$6="not realized",$B$10="not realized",$B$6="partly realized",$B$10="partly realized"),"TU","")), ",",(IF(OR($B$10="not realized",$B$13="not realized",$B$10="partly realized",$B$13="partly realized"),"UV","")),",",(IF(OR($B$13="not realized",$B$16="not realized",$B$13="partly realized",$B$16="partly realized"),"XY","")), ",",(IF(OR($B$16="not realized",$B$16="partly realized"),"WZ","")), " ")

  9. #9
    Registered User
    Join Date
    07-14-2016
    Location
    Bangalore, India
    MS-Off Ver
    2013
    Posts
    28

    Re: Nested IF AND OR

    Ah I missed that last blank space! It works Thanks a lot!

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,695

    Re: Nested IF AND OR

    No problem - easily done.

+ 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. Nested IF statement error. Nested True statement is not triggering
    By Lucas7040 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-26-2016, 11:41 AM
  2. Easier Way To Decipher Nested Nested IF's
    By Vladamir in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-06-2015, 03:37 PM
  3. [SOLVED] Nested Sumif's or how to sum data based on nested criteria
    By dlietz in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-07-2014, 11:36 AM
  4. How to reduces Nested IF code(144 Nested IF) to achive same functionality
    By jobseeker in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-09-2014, 09:45 AM
  5. Replies: 0
    Last Post: 10-01-2012, 05:54 AM
  6. For each loop nested; getting stuck on one cell in first iteration of nested loop
    By Excel_vba in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-22-2009, 11:54 AM
  7. help on a nested countif/nested if formula
    By vickiemc in forum Excel General
    Replies: 2
    Last Post: 08-13-2008, 08:29 AM

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