function to use to count value
=SUM(IF(A2:A8="apples", IF(D2:D8="red",1,0), 0))
*enter this one as an array formula
You'll get the same result and save a few keystrokes: (array enterd)
=SUM((A2:A8="apples")*(D2:D8="red"))
--
Biff
Microsoft Excel MVP
"Mike" wrote in message
...
In Excel 2007:
=COUNTIFS(A2:A8,"apples",D2:D8,"red")
In Excel 2003:
=SUM(IF(A2:A8="apples", IF(D2:D8="red",1,0), 0))
*enter this one as an array formula (instead of hitting enter, hit
ctrl+shift+enter)*
"Rae" wrote:
I want to count the number of record/rows that have a true condition when
column A and Column D equals "red apples"; how do I do this?
Example:
cell range a2 - a4 = apples
cell range a5 - a6 = pears
cell range a7 - a8 = apples
AND
cell range d2 = green
cell range d3 - d5 = red
cell range d6 - d7 = green
cell range d8 = red
I would expect to have a returned count value of 3 records/rows where
data
is "red apples".....make sense?
Thanks
|