COUNT and IF Array

B

bob

For every occurrence of a string in B9 in the current worksheet, I want to
count the number of cells that contain the letter W in Lineup Worksheet
F2:F83, where the string in Lineup Worksheet B2:B83 matches the string in B9.

I have tried using this formula but it counts all of the values in F2:F83; I
only want a count of those contaiing W.

=COUNT(IF($B9='Lineup Worksheet'!$B$2:$B$83,IF('Lineup
Worksheet'!$F$2:$F$83="W",0,0)))

Thanks,
Bob
 
T

Teethless mama

=SUMPRODUCT(--($B9='Lineup Worksheet'!$B$2:$B$83),--('Lineup
Worksheet'!$F$2:$F$83="W"))
 
D

daddylonglegs

Hello bob,

personally I'd use SUMPRODUCT as Teethless mama suggests but the reason your
formula doesn't work is that your second if returns 0 whether TRUE or FALSE -
change to:

=COUNT(IF($B9='Lineup Worksheet'!$B$2:$B$83,IF('Lineup
Worksheet'!$F$2:$F$83="W",1)))

confirmed with CTRL+SHIFT+ENTER
 

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