COUNTIF
xl2003.
If I select the cell and highlight the formula in the formulabar, then hit F9, I
see:
={2,1}
with two Red's and one Blue in A1:A25
If there are no Red's in the range, I see 0 in the cell.
If I do the same thing (evaluate the formula), I see:
={0,1}
Alan Beban wrote:
No; I meant =COUNTIF(A1:A25,{"Red","Blue"}) array entered. :-)
Excel 2002. What version are you using?
Note that I was responding to Gary's Student (who was proposing one
result for each color), not proposing a formula to return the sum.
Regards,
Alan
Dave Peterson wrote:
That didn't work for me.
I bet you meant:
=SUM(COUNTIF(A1:A25,{"Red","Blue"}))
(not an array formula)
Alan Beban wrote:
Gary''s Student wrote:
=COUNTIF(A1:A25,"Red")
=COUNTIF(A1:A25,"Blue")
Or simply =COUNTIF(A1:A25,{"Red","Blue"}) array entered into a
two-column row.
Alan Beban
--
Dave Peterson
|