简体   繁体   English

Excel 中跨多列条件的“IF”

[英]"IF" with conditions across multiple columns in Excel

My dataset looks like this:我的数据集如下所示:

在此处输入图像描述

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"如果 Name = "A" and Project = "TT" and Number > 5,写“PASS”否则写“FAIL”

If Name = "A" and Project = "NN" and Number > 10, write "PASS" otherwise write "FAIL"如果 Name = "A" and Project = "NN" and Number > 10,写“PASS”否则写“FAIL”

If Name = "B" and Project = "TT" and Number > 20, write "PASS" otherwise write "FAIL"如果 Name = "B" and Project = "TT" and Number > 20,写“PASS”否则写“FAIL”

I struggle puting together something that works with "IF" and "OR".我很难将适用于“IF”和“OR”的东西放在一起。

Would anyone be able to offer a simple solution?谁能提供一个简单的解决方案?

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 :然后使用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")

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM