如果用AND,或者在Excel中
我有以下格式的Excel数据:
severity Type Overview Classification Result critical defect closed Fix Good serious enhance no change no fix Low Medium defect no change no fix Low Low enhance closed fix Poor critical defect Duplicate fix Good Medium defect Duplicate fix Low Low defect Duplicate Poor
我写了公式来计算结果,但是由于我在Excel中的不好的知识,我无法执行。 任何帮助,将不胜感激。
这里是条件:
Severity Type Overview Classifcation Result Citical/Serious Defect/Enhance Closed Fix Good Defect/Enhance Closed No fix Poor Defect/Enhance Closed Updated Low Defect/Enhance Duplicate No fix poor Medium/low Defect/Enhance closed No fix Low Defect/Enhance Duplicate No fix Poor
假设你的数据在范围A1:D8,你的第一行是标题。 你可以使用这个(丑陋的)公式,它完全符合你在条件表中描述的内容:
=IF(AND(OR(A2="Critical",A2="Serious"),OR(B2="Defect",B2="Enhance")),IF(C2="closed",IF(D2="Fix","Good",IF(D2="No fix","Poor",IF(D2="Updated","Low"))),IF(AND(C2="Duplicate",D2="No"),"poor","No match")), IF(AND(OR(A2="Medium",A2="Low"),OR(B2="Defect",B2="Enhance")),IF(AND(C2="closed",D2="No fix"),"Low","No match"),IF(AND(C2="duplicate",D2="No fix"),"Poor")))
诀窍是使用其他条件作为一个elseif ..当你有很多是非常难以阅读。
这不是很好,但是对上一个表中定义的条件的解决scheme是这样的:
=IF(AND(OR(A2="Critical";A2="Serious");C2="Closed";D2="Fix");"Good";IF(AND(OR(A2="Critical";A2="Serious");C2="Closed";D2="No fix");"Poor";IF(AND(OR(A2="Critical";A2="Serious");C2="Closed";D2="Updated");"Low";IF(AND(OR(A2="Critical";A2="Serious");C2="Duplicate";D2="No fix");"Poor";IF(AND(OR(A2="Medium";A2="Low");C2="Closed";D2="No fix");"Low";IF(AND(OR(A2="Medium";A2="Low");C2="Duplicate";D2="No fix");"Poor";"Undefined"))))))
写在一个更可读,多行的时尚(我不知道这将继续复制和粘贴):
=IF(AND(OR(A2="Critical";A2="Serious");C2="Closed";D2="Fix");"Good"; IF(AND(OR(A2="Critical";A2="Serious");C2="Closed";D2="No fix");"Poor"; IF(AND(OR(A2="Critical";A2="Serious");C2="Closed";D2="Updated");"Low"; IF(AND(OR(A2="Critical";A2="Serious");C2="Duplicate";D2="No fix");"Poor"; IF(AND(OR(A2="Medium";A2="Low");C2="Closed";D2="No fix");"Low"; IF(AND(OR(A2="Medium";A2="Low");C2="Duplicate";D2="No fix");"Poor"; "Undefined" ) ) ) ) ) )
正如你所看到的,你没有覆盖的任何组合将导致"Undefined"
。 你可能可以结合一些条件,但这不一定会更可读。
解决scheme可能是一个完整的查找表与CHOOSE()和VLOOKUP()单独的表…