Excel help (counting things conditionally)

I love using you guys as my online help. :slight_smile:

I have a spreadsheet…and I want to count the values in column C, (let’s say C2:C9999), based on 2 conditions: the value in column C is > 0 and the corresponding value in column K2:K9999 = YES.

Similarly, what if I want to sum the values in column C, instead of just counting them?

I suspect COUNTIF and SUMIF are involved, but I can’t figure out how to do the 2-part logical condition.

If you’re using Excel v2007, you can try COUNTIFS() instead of COUNTIF().

If you’re stuck with Excel v2003, you can do contortions with SUMPRODUCT() or CSE array functions with {SUMIF()}

In Excel 2007, it’s easy: =COUNTIFS(C2:C9999,">0",K2:K9999,"=YES").
In Excel 2003, the easiest way is to just create a third column (which you can hide) that captures the joint condition and then just do the count off of that column.

use a nested if and put the results in a work column
I put my work columns at the far right, so they are out of my print range

put this in Z1 and copy down to Z999
=IF(+C1>0,IF(K1>0,C1,0),0)

at the bottom of C sum(z1:z999)

Nested if implies an AND condition if C1 >0 AND k1 >0 move value in “C” to Z1 Else move 0

Excel 2003; I came back to report that I’d thought of the work-around with the additional column with a double IF. So it appears unanimous…thanks!