Reputation: 97
I need to count how many "1" that match a row and column condition.
Here's an example:
As I said, I want to count all "1" that cond1 matches "1" and cond2 matches "1". The result should be 2.
I've started with this function, without success:
=COUNTIF(INDEX(B4:C10,MATCH(1,A4:A10,0),MATCH(1,B3:C3,0)),1)
Thanks for your help!!
Upvotes: 0
Views: 789
Reputation: 152450
Use COUNTIFS and remove the match on column A into its own range and criteria:
=COUNTIFS($A$4:$A$10,1,INDEX($B$4:$C$10,0,MATCH(1,$B$3:$C$3,0)),1)
Another option using SUMPRODUCT():
=SUMPRODUCT((A4:A10=1)*(B3:C3=1)*(B4:C10=1))
Upvotes: 1