=COUNTIF Problem

M

Mike

Hello
Using Excel XP.

I am doing a baseball stat spreadsheet and I have pitchers names in column A
and in column B I have a W (for a win) or L (for a loss). What I want to do
is to check column A for a pitcher's name, e.g. "Schilling" and then to
check column B for a "W.
An example:

A B
---------------------
1 Wells L
2 Schilling W
3 Clement L
4 Wells W
5 Schilling L
6 Clement W
7 Wells L
8 Schilling W

Then I would have the stat set up like this: I would type "Schilling" in
A10 and then I would like to have a formula in B10 that gave me the number
of "W" in column B for "Schilling", which would be 2 in this instance. I've
tried a =countif formula but cannot write it for two conditions. Any help
will be apprecaited.

Mike
 
P

Paul B

Mike, here is one way, to get the count
=SUMPRODUCT((A1:A9="Schilling")*(B1:B9="W"))
to do the second part put this in B10 =SUMPRODUCT((A1:A9=A10)*(B1:B9="W"))

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003
 
B

Bill Kuunders

=SUMPRODUCT(--(A2:A9 ="Schilling"),--(B2:B9="W"))
Should do it.
You can also refer to a cell rather than the name
=SUMPRODUCT(--(A2:A9 =A10),--(B2:B9="W"))
 

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

Similar Threads

CountIf 1
COUNTIF 2
Date Field Subtraction 3
Scrabble Value calculation for Welsh words 0
Winning & Losing Streaks 3
Averaging 5
Running Win-Lost Record 4
More than a simple sumif?? 2

Top