Forum Discussion

Zuceth's avatar
Zuceth
Copper Contributor
Oct 12, 2023
Solved

Combining IF, AND and OR statements

I am trying to combine these two formulas together =IF(AND(A1="vacant",B1="c"),1,0) and =IF(AND(A1="vacant",B1="d"),1,0).

Basically what I want is IF A1 is vacant position and B1 is D or C, true. If not false. 

I am not well versed in formulas and all the research I've done and try to implement gives me an error return.

 

staffedD
vacantC
vacantD
staffedC
vacantC
staffedD
  • Zuceth 

    =AND(A1="vacant", OR(B1={"C", "D"}))

     

    or if you prefer

     

    =IF(AND(A1="vacant", OR(B1={"C", "D"})), 1, 0)

     

    or even

     

    =(A1="vacant")*OR(B1={"C", "D"})

  • Zuceth 

    =AND(A1="vacant", OR(B1={"C", "D"}))

     

    or if you prefer

     

    =IF(AND(A1="vacant", OR(B1={"C", "D"})), 1, 0)

     

    or even

     

    =(A1="vacant")*OR(B1={"C", "D"})

    • Zuceth's avatar
      Zuceth
      Copper Contributor
      Thank you Hans, I used =IF(AND(A1="vacant", OR(B1={"C", "D"})), 1, 0) and it works. I appreciate the help!

Resources