I meant a conditional COUNTIF like the Conditional SUMIF wizard....
Rebecca
I didn't look yet at my reply to Jarrod. I'll do so in a minute.
Back to your question:
Lets assume the following data in A1:B7.
{"Apple","Red"; "Pear","Green"; "Apple","Green"; "Apple","Yellow"; "Apple","Blue"; "Apple","Red"; "Orange","Orange"}
In C1 array-enter: =SUM((A1:A7="Apple")*(B1:B7="Red"))
In order to array-enter an array-formula you need to hit CONTROL+SHIFT+ENTER (not just ENTER).
The above formula results in a count of 2, meaning there are 2 apples having color red.
If you want to count non-red apples, just change the second term's = operator to the <> operator.
What about counting all apples that are NOT blue or NOT yellow: Array-enter
=SUM((A1:A7="Apple")*(B1:B7<>"Blue")*((B1:B7<>"yellow")))
Aladin
===============
Re: Conditional Sum vs. Condtional Count
Conditional SUM formulas can be used to count just as easily as they can be used to sum. Take the following formula:
{=SUM(IF(A2:A20="Apple",1,0))}
For every instance of "Apple" in A2:20, it'll count 1, because a 1 is specify in the THEN part of the IF-THEN function. If you want to add more conditions, you can keep nesting IF statements, like this:
{=SUM(IF(A2:A20="Apple",IF(B2:B20="Red",1,0),0))}
-Ben
Re: Conditional Sum vs. Condtional Count
Ben
Nested IFs can be easily avoided with the Boolean array formulas. See my reply above in this thread. Indeed, one must be aware of the distinction Multiconditional Count vs Multiconditional Sum.
Regards,
Aladin
Re: Multiconditional Count
Thanks for the advice, Aladin. That will make constructing conditional sum formulas a lot easier in the future. I learned to create them by using the Conditional Sum Wizard, which nests IF statements. This really is a lot simpler. Thanks,
-Ben
Re: Conditional Sum vs. Condtional Count
You guys are magic--thanks!