Which (logical) function?

J

JustJill

Table was codes...if the ID begins with a w and the number in the second
column is a 1 add the ones (which are male ;)

A B
1 ID Gender
2 W01 2
3 W02 1
4 G01 1
5 W08 1

I have: =COUNTIF(A$2:$A$5,"=w??")*AND(COUNTIF(B$2:$B$5,"1"))...which isn't
correct because it returns 3 (all the w's) I suppose.

What do I do???

TIA!
 
F

Fred Smith

For more than one criteria, use Sumproduct, as in:
=sumproduct((left(a2:a5)="w")*(b2:b5=1))

Regards,
Fred
 

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