View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bpeltzer
 
Posts: n/a
Default SumProduct With Multiple criteria

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$60))
and =SUMPRODUCT(--($B$2:$b$6=10),--($b$2:$b$6<=20),--($a$2:$a$6<0))


"Tony D" wrote:

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$60),$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