[英]IF Function, Excel - How do I set a value to True if column A1:A10 is set to “Pass”?
I'm trying to set a cell (J2) to say Completed
if cells G2:G41 all have a value of "Pass"
else display Bugs
if any of those cells have "Fail"
in them. 我想设置的小区(J2)的说法Completed
,如果细胞G2:G41 所有具有值"Pass"
其他显示Bugs
是否有这些细胞的有"Fail"
在其中。
The formula I've got at the moment is: 我现在得到的公式是:
=IF(G2:G41="Pass", "Completed", "Bugs")
But it keeps saying Completed
when cell G41 is set to "Fail"
. 但是当单元格G41设置为"Fail"
时,它总是说Completed
。 How do I fix this? 我该如何解决?
Maybe this... 也许这个...
=IF(COUNTIF(G2:G41,"Pass")=ROWS(G2:G41),"Completed","Bugs")
Edit: If the range G2:G41 may contains blanks and you only want to count if all the filled cells in this range have "Pass" in them, you may try something like this... 编辑:如果范围G2:G41可能包含空白,并且您只想计算该范围内所有填充的单元格中是否都包含“通过”,则可以尝试如下操作:
=IF(COUNTIF(G2:G41,"Pass")=COUNTA(G2:G41),"Completed","Bugs")
So the edited formula will ignore the blank cells in the range G2:G41. 因此,编辑后的公式将忽略G2:G41范围内的空白单元格。
Since you are not entering an ARRAY function, excel evaluates only the value of the first cell, G2. 由于您没有输入ARRAY函数,因此excel仅评估第一个单元格G2的值。
Another approach: 另一种方法:
=IF(NOT(SUM(--(G1:G41<>"pass"))),"Completed", "Bugs")
And press ctrl+shift+enter to complete formula. 然后按ctrl + shift + enter完成公式。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.