简体   繁体   English

仅计算两列之间的一个实例,其中第三列在 EXCEL 公式中具有特定值

[英]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. COUNTIFSSUMPRODUCT是我能想到的两种方式。 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)如果AB列包含任何值,则以下公式将返回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.

相关问题 EXCEL-两张纸匹配多列后的第三列返回值 - EXCEL- Return Value of 3rd Column After Matching Multiple Columns In Two Sheets Excel:- 比较 2 列,然后复制第 3 列中的值 - Excel:- Comparing 2 columns and then copying value in 3rd column 在Excel中匹配2列以在第3列中显示值 - Match 2 columns in excel to show value in a 3rd column Excel Function 在两列中计算给定值,如果该值在一列或两者中,则计算 - Excel Function to count a given value across two columns, where it counts if the value is in one column or both 根据两列匹配返回第三列值 - Returning a 3rd column value based on two columns matching Excel公式根据第三列中的值在第一列中输出名称 - Excel formula to output name in first column based on a value in the 3rd column Excel中两列之间的部分匹配,一列的返回值 - Partial match between two columns in excel, return value of one column Python 或 Excel:如何比较 2 列,然后在新列中写入第 3 列的值? - Python or Excel: How can you compare 2 columns and then write the value of a 3rd column in a new column? Excel公式在两列中搜索一列中的唯一值,在另一列中搜索固定值 - Excel formula to search two columns for unique value in one column and fixed value in another 检查两列的条件并相应地填充 excel 中第三列的值 - Checking condition from two columns and accordingly populate values from 3rd column in excel
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM