简体   繁体   English

Excel:如何根据列中的特定值对行进行计数?

[英]Excel: How to count rows based on specific values in columns?

I need to count the number of rows containing specific values in multiple columns. 我需要计算多列中包含特定值的行数。 More specifically, to count these rows, I need to check columns with particular values in their headers. 更具体地说,要计算这些行,我需要检查其标题中具有特定值的列。 Take a look at the screenshot below: 看下面的截图:

截图

I need to count all those rows which have an 'x' under at least one column that has 'APP' as a column header. 我需要计算至少在以“ APP”作为列标题的一列下具有“ x”的所有行。 In this case, there are two rows which have an 'x' under at least one column with APP as its header, and one row which does not. 在这种情况下,有两行至少在以APP为标题的一列下带有一个“ x”,而另一行则没有。 Is there any formula that will allow me to count this? 有什么公式可以让我计算一下吗?

One brute force way of doing this would be to count if there are 'x's under columns with 'APP' headers and then counting all those rows which have more than zero. 一种行之有效的方法是计算是否有带有“ APP”标题的列下的“ x”,然后计算所有大于零的行。 But if there is a way to simplify this that would be great. 但是,如果有一种简化方法,那就太好了。

您可以尝试(对在标题中带有“ APP”而在列中带有“ x”的行进行计数):

=SUMPRODUCT((A1:G1="APP")*(A2:G4="x"))

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

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