Home > front end >  "IF" with conditions across multiple columns in Excel
"IF" with conditions across multiple columns in Excel

Time:05-03

My dataset looks like this:

enter image description here

I am looking for a formula to add to the column "Status" to do the following:

If Name = "A" and Project = "TT" and Number > 5, write "PASS" otherwise write "FAIL"

If Name = "A" and Project = "NN" and Number > 10, write "PASS" otherwise write "FAIL"

If Name = "B" and Project = "TT" and Number > 20, write "PASS" otherwise write "FAIL"

I struggle puting together something that works with "IF" and "OR".

Would anyone be able to offer a simple solution ?

Thanks in advance.

CodePudding user response:

Breaking this into parts:

  • AND(A2="A",B2="TT",C2>5)
  • AND(A2="A",B2="NN",C2>10)
  • AND(A2="B",B2="TT",C2>20)

Then using OR:

=IF(OR(AND(A2="A",B2="TT",C2>5),AND(A2="A",B2="NN",C2>10),AND(A2="B",B2="TT",C2>20)),"PASS","FAIL")

enter image description here

  • Related