Posted to microsoft.public.excel.worksheet.functions
|
|
Using CountIf with 2 conditions - help!
Thanks SO much! How did I not not know about SUMPRODUCT before???
"Max" wrote:
"Sarah" wrote:
I have 2 columns of data. I want to ask Excel to look in column 1, determine
which rows match the condition, then look at column 2 and in those rows which
matched the condition, count how many have values in them i.e. exclude
blanks. Not sure how to build 2 conditions into a countif - any ideas??
Use SUMPRODUCT ..
Assuming your 2 cols are cols B and D,
where col B houses eg: Name1, Name2, etc
and col D may or may not contain figures
With E1, E2 containing: Name1, Name2, ...
we could put in say, F1:
=SUMPRODUCT(($B$1:$B$100=E1)*($D$1:$D$100<""))
and copy down
Adapt the ranges to suit, but note that we can't use entire col references
(eg: A:A, B:B) in SUMPRODUCT
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
|