• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to count values in a column matching multiple criterias

cyrilz

New Member
Hello All,


I'm a big fan of sumproduct formula but I'm a bit stuck with this one.


I have a column of persons from a database in column A, representing people in teams.

I have a list of people in one of the teams in column B


I want to count the number of time the people in column B apperas in column A.


Let me show you this :

[pre]
Code:
Column A    Column B
A           A
A           B
C
B
B
[/pre]
...would give me 5.


the number of people in column B is variable.


I've thought about sumproduct( --( OFFSET(A1,1,0,COUNTA(A:A)-1;1)= OFFSET(B1,1,0,COUNTA(B:B)-1,1)).

But this doesn't work.


Any idea would be greatly appreciated.


Cyril
 

Hui

Excel Ninja
Staff member
Cyril

Shouldn't your answer be 4 in your example?


I would use the DCOUNTA function


Setup in A1:B6 as

[pre]
Code:
Team	Team
A	=A
A	=B
C
B
B
[/pre]
B2: ="=A"

B3: ="=B"


the use =DCOUNTA(A1:A6,"Team",B1:B3)
 
Top