Forum Discussion

Officeuser7777's avatar
Officeuser7777
Copper Contributor
Jun 16, 2024
Solved

Counting instances across three columns not just one

Hi, I am trying to figure out how to code for the resulting tables #1 and #2 in the screenshot, based on the data table. Each publication can be characterized by 1 to 3 categories of humour in domain A and 1-3 categories of group in domain B. I manually created the tables I want to achieve (#1 and#2 in the screenshot) to demonstrate what I want to do. I can make a pivot table with publication type and one column of the humour categories, but I can't figure out how to make a pivot table or use a function like COUNTIFS to do it across 3 columns. I could brute force a solution by copy/pasting all the responses into one big linear spreadsheet but there must be a more elegant way. (These are made up data to demonstrate what I am after). Thank you.

 

 

  • Officeuser7777 

    You can count your entries with a combination of FILTER() and SUMPRODUCT().

    =SUMPRODUCT(--(TOCOL(FILTER(Publication[[Acategory1]:[Acategory3]],Publication[Type]=B$16),1)=$A17))

    COUNTIF() does not seem to work with a filtered list.

4 Replies

Resources