简体   繁体   English

Excel 索引匹配 Countif - 尝试计算匹配 2 个条件的多个值

[英]Excel Index Match Countif - trying to count multiple values that match 2 conditions

I'm trying to write a formula to count the "ShowEnterConfirmationNumber" instances in column L, but only when the cell below it is blank and there is an instance of 'FALSE' in column H in the row below it.我正在尝试编写一个公式来计算 L 列中的“ShowEnterConfirmationNumber”实例,但仅当其下方的单元格为空白且其下方行的 H 列中有一个“FALSE”实例时。

I've tried Match, index and Countifs but can't seem to find the right combination to return a count of these based on the above conditions.我已经尝试过 Match、index 和 Countifs,但似乎无法找到正确的组合来根据上述条件返回这些计数。 Can anyone help?任何人都可以帮忙吗?

在此处输入图片说明

Use a helper column (eg M), add this test in cell M2 and auto-fill down :使用辅助列(例如 M),在单元格 M2 中添加此测试并自动填充:
=AND(L1="ShowEnterConfirmationNumber";L2="";H2="FALSE")
and then count all TRUE (1) values in column M.然后计算列 M 中的所有 TRUE (1) 值。

And if you want everything in a single cell, without helper column, you can use this :如果你想要一个单元格中的所有内容,没有辅助列,你可以使用这个:
=COUNTIFS($L$1:$L$10;"ShowEnterConfirmationNumber";$L$2:$L$11;"";$H$2:$H$11;"FALSE")
I stopped at row 10, so you have of course to replace this with the row number with the last value in your dataset.我停在第 10 行,因此您当然必须将其替换为包含数据集中最后一个值的行号。 Please also be careful for the test on "FALSE";还请注意“FALSE”的测试; my syntax works if in your data it is entered as a text string;如果在您的数据中将其作为文本字符串输入,则我的语法有效; if it is a real Boolean, you probably have to do remove the "" around the FALSE in the formula.如果它是真正的布尔值,您可能必须删除公式中 FALSE 周围的“”。

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

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