Coutnif

M

Matt

I need help with a countif statement. I have information like the following:

A B
X 1
Y 1
X 2
X 0

I need to count how many times X in column A is greater than zero in column B.
 
F

Fred Smith

Countif can handle only one condition. For multiple conditions, use
Sumproduct, as in:

=sumproduct(--(a1:a5="X"),--(b1:b5>0))

Regards,
Fred.
 
S

ShaneDevenshire

Hi,

And here are two old school formulas:

=SUMPRODUCT((A2:A5="X")*(B2:B5>0))
=SUM((A2:A5="X")*(B2:B5>0)) this one array entered (Shift+Ctrl+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