Left as a condition in SUMPRODUCT
You can add more requirements with something like:
=sumproduct(--(a1:a10="hi"),--(b1:b10="there"),c1:c10)
(And-ing column A with column B)
You could use:
=sumproduct(--(((a1:a10="hi")+(b1:b10="there"))0),c1:c10)
(Or-ing column A with column B)
This was recently posted by Peo Sjoblom:
One way
=SUMPRODUCT(--(A2:A10="N"),--((B2:B10=4)+(B2:B10=5)0))
another
=SUMPRODUCT(((A2:A10="N")*(B2:B10={4,5})))
======
Can you figure out what it does? <bg (answer below...)
Those people who answer lots of questions in .worksheet.functions are pretty
darn smart.
If you have followup questions, you may want to post in that newsgroup with the
details.
..scroll down for the answer
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
From the OP:
What I am trying to do is to count the number of "N"s in a column that
happen to be in the same row with another column that shows a 4 or 5.
Kigol wrote:
Yes of course that makes sense. Thank you. Also, I have tried a few
times in the past but to make sure. You cannot use OR or AND in
SUMPRODUCT functions correct? You would just have to SUM two different
SUMPRODUCT functions with different conditions?
--
Dave Peterson
|