[英]COUNT only one instance between two columns where 3rd column have specific value in EXCEL formula
Please can you help me in excel.请你能在excel中帮助我吗? I cannot figure it out how to count only one instance where two columns have any value and where 3rd column have specific value like "cat".我无法弄清楚如何只计算一个实例,其中两列具有任何值,而第三列具有特定值,例如“cat”。
Example:例子:
A |B |C ID540|S3000 |cat =1 A |B |C SD-10| |cat =1 A |B |C |436346 |cat =1
So, if the "cat" is selected then excel goes through A, B and C rows.因此,如果选择了“猫”,则 excel 将遍历 A、B 和 C 行。 The sum would be "1".总和将为“1”。
Any clues ?任何线索? Big thanks!十分感谢!
You could accomplish this many ways.您可以通过多种方式实现这一点。 COUNTIFS
or SUMPRODUCT
are two ways I can think of off the top of my head. COUNTIFS
或SUMPRODUCT
是我能想到的两种方式。 I prefer SUMPRODUCT
.我更喜欢SUMPRODUCT
。
The following formula will return 1
if the A
and B
columns contain any value, and the C
column specifically contains the text cat
: (Otherwise, 0
is returned)如果A
和B
列包含任何值,则以下公式将返回1
,而C
列专门包含文本cat
:(否则返回0
)
= SUMPRODUCT(COUNTA(A1),COUNTA(B1),(C1="cat")+0)
Type this formula into cell D1
and drag down as far as necessary.将此公式键入单元格D1
并根据需要向下拖动。
EDIT编辑
Based on discussion, formula should be this:根据讨论,公式应该是这样的:
= ((SUMPRODUCT((ISBLANK($A3:$B1002))+0)=0)+0)*((SUMPRODUCT((C3:C1002<>"cat")+0)=0)+0)
EDIT (again)编辑(再次)
Based on further discussion, formula should be this: (line break added for readability)基于进一步的讨论,公式应该是这样的:(为了可读性添加了换行符)
= ((SUMPRODUCT(ISBLANK($A3:$A1002)+0)=0)+0)*
((SUMPRODUCT(ISBLANK($M3:$M1002)+0)=0)+0)*
((SUMPRODUCT((C3:C1002<>"cat")+0)=0)+0)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.