Excel - 如果条件具有三个值

Excel - If condition with three values

我想检查三个单元格,如果前两个是 "Yes",则将文本放入特定单元格,如果所有三个都是 "Yes",则在该特定单元格中放入不同的文本。

示例:

Yes | Yes | No  | "Sort of Working"
Yes | Yes | Yes | "Working
No  | No  | Yes | "Not working"

基本上,如果三个都说是那么它是"Working"如果不是,那么它是"Not working"通过使用公式

谢谢

您可以在 IF() 内嵌套 AND()

=IF( AND(A1="Yes", A2="Yes", A3="Yes"), "Working", "Not Working" )

三个电池大约是我在 AND function. Any more and I would perform a conditional count (COUNTIF function) 内对堆叠条件的限制并比较数字。

=IF(COUNTIF(A1:A3, "Yes")=3, "Working", "Not Working")

备用:

=LOOKUP(COUNTIF(A1:A3, "Yes"), {0,1,2,3}, {"Not Working","Not Working","Sort of Working","Working"})
=IFERROR(CHOOSE(COUNTIF(A1:A3, "yes")-1, "Sort of Working","Working"), "Not Working")