[英]How to count number of “Yes” in column C once only if ID in column B repeats
I need help counting Yes in column C, but only count it once if ID in column B repeats 我需要帮助在C列中计算是,但只有在B列中的ID重复时才计算一次
Sample of output. 输出样本。 for sample below count should be 6.
对于低于计数的样本应为6。
Here is dropbox file link. 这是dropbox文件链接。 Dropbox file link
Dropbox文件链接
I can do this already via if and else condition using formula, but I would like someone can come up with better way using single line formula. 我已经可以通过if和else条件使用公式来做到这一点,但我希望有人可以使用单行公式提出更好的方法。
Current solution in cell F2 细胞F2中的当前解决方案
=IF(B2<>B1,IF(C2="Yes","1",""),IF(B2=B1,IF(F1="1","",IF(B2=#REF!,"",""))))
in cell F3 and down 在单元格F3和向下
=IF(B3<>B2,IF(C3="Yes","1",""),IF(B3=B2,IF(F2="1","",IF(B3=B1,"",""))))
Then I just count all ones and get total 1. 然后我只计算所有的并得到总数1。
=countif(F2:F159,"1")
You can use a similar approach to my previous answer in your link, ie using cell refs in your dropbox example 您可以在链接中使用与我之前答案类似的方法,即在您的Dropbox示例中使用单元格引用
=SUM(IF(FREQUENCY(IF(I2:I14="Yes",H2:H14),H2:H14),1))
confirmed with CTRL+SHIFT+ENTER
用
CTRL+SHIFT+ENTER
H2:H14 has to be numeric data H2:H14必须是数字数据
Generically, assuming Range 4 is numeric you can use this formula for up to 3 conditions 一般来说,假设范围4是数字,您可以将此公式用于最多3个条件
=SUM(IF(FREQUENCY(IF((Range1="x")*(Range2="y")*(Range3="z"),Range4),Range4),1))
conditions can be added or removed as required 可以根据需要添加或删除条件
把它放在D2中并向下拖动:
=IF(COUNTIFS(B$2:B2,B2,C$2:C2,"Yes")=1,1,"don't count")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.