[英]Excel complicated count function
I have kind of a complicated count I can't seem to figure out. 我有点复杂,我似乎无法弄清楚。 Basically I have a table that looks similar to this image:
基本上,我有一张看起来与此图像相似的表:
Now what I need to do is: 现在我需要做的是:
Is there any way I can count the occurrences of 1|2|3 and have it separated by category like this? 我有什么办法可以计算1 | 2 | 3的出现并按类别将其分开?
Sorry, kind of an Excel noob here. 抱歉,这里有点Excel菜鸟。 I didn't think pivot tables would be correct though (especially because they want the dates to be columns, plus I couldn't figure out how to insert a conditional).
我并不认为数据透视表会是正确的(特别是因为它们希望日期为列,再加上我无法弄清楚如何插入条件表)。 Any pointers in the right direction would be appreciated.
朝正确方向的任何指针将不胜感激。
Let's suppose that your screenshot shows cells A1:I6. 假设您的屏幕截图显示了单元格A1:I6。
Then ... 然后 ...
=COUNTIF($C2:$I2,J$1)
into J2 and copy it across and down =COUNTIF($C2:$I2,J$1)
放入J2,然后向下复制 =SUMIF($B$2:$B$6,$A10,J$2:J$6)
into B10 and copy it across and down =SUMIF($B$2:$B$6,$A10,J$2:J$6)
放入B10,然后将其复制并向下复制 My guess is that someone cleverer than I could construct a sumproduct
formula for B10 that works without the need for the helper columns J:L. 我的猜测是,比我聪明的人可以为B10构造一个
sumproduct
公式,而无需使用助手列J:L。
[Edit] Using Maki's sumproduct
formula in my structure, you can scrap helper values in cols J:I and put this into B10 -- =SUMPRODUCT(($B$2:$B$6=$A10)*($C$2:$I$6=B$9))
[编辑]在我的结构中使用Maki的
sumproduct
公式,可以在cols J:I中sumproduct
辅助值并将其放入B10中=SUMPRODUCT(($B$2:$B$6=$A10)*($C$2:$I$6=B$9))
assuming that you start from cell A1, 假设您从单元格A1开始,
=SUMPRODUCT((list name to search for)*(value to search in the data area)) = SUMPRODUCT((要搜索的列表名称)*(要在数据区域中搜索的值))
=SUMPRODUCT(($B$2:$B$6="Anon")*($C$2:$I$6=1))
=SUMPRODUCT(($B$2:$B$6="Anon")*($C$2:$I$6=2))
... ...
=SUMPRODUCT(($B$2:$B$6="Watterson")*($C$2:$I$6=1))
...etc. ...等等。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.