how to count cells...

H

hal9000

how to count cells that contains string AAAA in cell P1 to
P222 AND also contains string BBBB in cell B1 to B333?
something i imagine is:
 
A

Arvi Laanemets

Hi

As you used AND to bind 2 conditions, you can drop B223:B333 part for 2-nd
condition. Then
=SUMPRODUCT((P1:p222="AAAA")*(B1:B222="BBBB"))
 
H

hal9000

=SUMPRODUCT((P1:p222="AAAA")*(B1:B222="BBBB"))

thank you for the reply.
is it possible to use wildcards?
the asterisk and the question mark does not work; ie,
=SUMPRODUCT((P1:p222="A*")*(B1:B222="B*"))
=SUMPRODUCT((P1:p222="A???")*(B1:B222="B???"))
 
A

Arvi Laanemets

Hi

Why not
=SUMPRODUCT((P1:p222>="A")*(B1:B222>="B"))
=SUMPRODUCT((P1:p222>="A")*(P1:p222<"B")*(B1:B222>="B")*(B1:B222<"C"))
 
Top