简体   繁体   English

IF Function,Excel-如果将A1:A10列设置为“通过”,如何将值设置为True?

[英]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.

相关问题 如何匹配/搜索excel VBA中Sheet2.Range(“A1:A10”)中的Sheet1.Range(“A1”)的值 - How to match/search the value of Sheet1.Range(“A1”) in Sheet2.Range(“A1:A10”) in excel VBA 有没有一种简洁的方法来做 Range(“A1:A10”).Value = Range(“A1:A10”).Value + 1 in vba - Is there a concise way to do Range(“A1:A10”).Value = Range(“A1:A10”).Value + 1 in vba 如何在A1到A10提示输入框之间创建单击功能,以便用户在vba中输入数字 - How can i create click function between A1 to A10 prompt inputbox for user to enter numbers in vba Excel:如何通过这种公式使用INDIRECT:{= MATCH(2,1 /(A1:A10 =“ something”))}} - Excel: how to use INDIRECT with this kind of formula: {=MATCH(2,1/(A1:A10=“something”))} Excel VBA paramArray与-A1:A10不太相似 - Excel VBA paramArray doesn't much like -A1:A10 如何添加超过240个条目的每个第3行的值(例如:a1,a4,a7,a10等)? - How to add every 3rd row's value (ex: a1, a4, a7, a10, etc) with over 240 entries? 如何一次将一个单元格(例如(A1; B1; C1)或数组(A1:C1))传递到Excel的XLL文件的相同C函数? - How do I pass a cell at a time, e.g. (A1; B1; C1) or an array (A1:C1) to the same C function of Excel's XLL file? 如何在一个数组为(A1:A10 = B1:B1000)的情况下编写SUMPRODUCT - How to write SUMPRODUCT where one array is (A1:A10 = B1:B1000) 如何为这个excel公式设置四月的第一周? =WEEKNUM(A1) - how can I set the first week of april for this excel formula? =WEEKNUM(A1) 如何在Excel VBA中将超链接设置为每个席位的A1单元格? - How to set the hyperlink to the A1 cell of each seat in Excel VBA?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM