counting cells using multiple criteria

S

st120869

Hi,
how do a create a custom function to count cells (text) based on more
than criteria. Example

column a - lists critiera 1 (text)
column b - list criteria 2 (text)

I would like to be able to count number of cells from colulmn b that
match citieria 1 and 2.

I have tried multiple countif and counta and sum product but not
getting the correct result
 
B

Bob Phillips

=sumproduct(--(rng1="text1"),--(rng2="text2"))

Note that SUMPRODUCT doesn't work with complete columns, you have to specify
a range.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
S

st120869

THanks, I get a #value error.

I ahve include some text below
Reward no
Reward no
Reward Yes
Reward Yes
Reward Yes
Reward Yes
Reward Yes
Reward Yes
xx1 Yes

the result I would expect to see if criteria is column A ="reward" &
column B = "yes" would be 7
 
B

Bob Phillips

=SUMPRODUCT(--(A1:A100="Reward"),--(B1:B100="Yes"))

works for me, but with a result of 6

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
S

st120869

Bob,
your maths is better than mine !!, I have recopied your formula but
still getting a #value error - any clues??
 
B

Bob Phillips

Not really, can you post the workbook somewhere?

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 

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