count number of rows with 2 matching text cells

S

smcmoran

I have a data sheet with data listing users and a product group. I need to
count the number of occurances where the user and group match. so on the
second sheet i need to fill cells with the count of "IF !A:A = "X" and !B:B =
"Y"". I have been trying countif and sumproduct with no luck. I can get the
sum of both individual matches but not when the combination matches.

Any ideas?

Thanks
Scott
 
S

smcmoran

Thanks but I get zero for the result, no error, but no count. I should get
a result of 15 with the example data I'm using.

Scott
 
P

Peo Sjoblom

It should work

maybe you have trailing or leading spaces

=SUMPRODUCT(--(TRIM(A2:A20)="X"),--(TRIM(B2:B20)="Y"))

if that doesn't work you must have invisible html characters

--


Regards,


Peo Sjoblom
 
S

Stephen

Try using

=SUM(--(A1:A30=B1:B30))

This is an array formula, so you need to use Ctrl+Shift+Enter rather than
just Enter when you first enter the formula or whenever you edit it.

Stephen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top