Reputation: 7
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?
Sorry, kind of an Excel noob here. 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.
Upvotes: 0
Views: 102
Reputation: 1647
Let's suppose that your screenshot shows cells A1:I6.
Then ...
=COUNTIF($C2:$I2,J$1)
into J2 and copy it across and down =SUMIF($B$2:$B$6,$A10,J$2:J$6)
into B10 and copy it across and downMy 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.
[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))
Upvotes: 1
Reputation: 637
assuming that you start from cell A1,
=SUMPRODUCT((list name to search for)*(value to search in the data area))
=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.
Upvotes: 0