Forum Discussion

AL789's avatar
AL789
Copper Contributor
Dec 18, 2019
Solved

Help: IF statement with Multiple AND , OR conditions

Hi everyone,

 

I need some help writing an IF statement that includes multiple AND and OR conditions. See the sample file attached. I want to write an IF statement that will meet all of the conditions listed in the sample file and that will achieve the results listed in the "decreased risk" column. 

 

Any suggestions?

5 Replies

    • AL789's avatar
      AL789
      Copper Contributor
      Thank you. This worked perfectly for what I am trying to achieve.
  • Haytham Amairah's avatar
    Haytham Amairah
    Silver Contributor

    AL789

     

    Hi,

     

    Please see if this formula below achieve what you want:

    =IF(A2="Yes","Yes",
    IF(AND(A2="No",B2="off"),"No",
    IF(AND(
    OR(A2="Off",A2="Null",A2="DKNS"),
    OR(B2<>"Off",B2<>"Null",B2<>"DKNS")),"Yes",
    "DKNS")))

     

    This one gives the same result with the new function IFS:

    =IFS(A2="Yes","Yes",
    AND(A2="No",B2="off"),"No",
    AND(
    OR(A2="Off",A2="Null",A2="DKNS"),
    OR(B2<>"Off",B2<>"Null",B2<>"DKNS")),"Yes",
    TRUE,"DKNS")

     

    Hope that helps

    • AL789's avatar
      AL789
      Copper Contributor
      Thank you for the response. Unfortunately this didn't provide all of the results I needed, but I found a formula that did.

Resources