countif with a twist

E

Ed

The twist is that that I need the criteria in my countif
function to be based on two things and on of those things
is based on another range. For instance, the function
I'm looking for would tell me how many cells in a range
are greater than zero AND have an adjacent cell (same
row, different column) containing a value that is equal
to a particular string, say "AA".

All help is greatly appreciated. Thanks.
 
F

Frank Kabel

Hi Ed
COUNTIF accepts only one condition. You can use SUMPRODUCT. e.g.,
=SUMPRODUCT((A1:A999>0)*(B1:B999="AA"))
this will count alls cells which are greater than zero and have the
string "AA" in the adjacent column

To sum the cells in column A which met the criteria use
=SUMPRODUCT((A1:A999>0)*(B1:B999="AA")*(A1:A999))

HTH
Frank
 
G

Guest

Thanks - this does the job!
-----Original Message-----
Hi Ed
COUNTIF accepts only one condition. You can use SUMPRODUCT. e.g.,
=SUMPRODUCT((A1:A999>0)*(B1:B999="AA"))
this will count alls cells which are greater than zero and have the
string "AA" in the adjacent column

To sum the cells in column A which met the criteria use
=SUMPRODUCT((A1:A999>0)*(B1:B999="AA")*(A1:A999))

HTH
Frank



.
 

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