SumProduct With Multiple criteria

T

Tony D

Hi, trying get sumproduct formula to correctly count positive and negative
p&l if the stock price is >=10 and <=20. I have written:
=SUMPRODUCT(--($B$2:$b$6>=10),--($b$2:$b$6<=20),--($a$92:$a$6>0),$a$2:$a$6)
which results in 300, for the negative total I used
=SUMPRODUCT(--($B$2:$b$6>=10),--($b$2:$b$6<=20),--($a$92:$a$6<0),$a$2:$a$6)
which gives me -370. But I need to count? Thanks

P&L Price
(120) 10
300 12
(100) 14
(150) 15
30 25
200 26
 
B

bpeltzer

Just take out the last array argument to the sumproduct function:
=SUMPRODUCT(--($B$2:$b$6>=10),--($b$2:$b$6<=20),--($a$2:$a$6>0))
and =SUMPRODUCT(--($B$2:$b$6>=10),--($b$2:$b$6<=20),--($a$2:$a$6<0))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top