View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
David Biddulph[_2_] David Biddulph[_2_] is offline
external usenet poster
 
Posts: 8,651
Default SUMPRODUCT on filtered rows

=SUMPRODUCT((A2:A6=1)*B2:B6*C2:C6)

The answer is 5, of course, not 6.
--
David Biddulph

"vsoler" wrote in message
...
I have a rectangular range of number, with a row header on top of it.
Then I apply a filter.

Say that I want the sumproduct of the visible cells in columns B & C

A B C
1 1 2
0 2 1
1 3 -1
1 2 3
0 1 2

Then I filter on column A equal to 1

The figure that I need is 1*2+3*(-1)+2*3 = 6
If I use the Sumproduct function I get 10, because the rows starting
with 0 are not filtered out.

Can I get the result I want with sumproduct? (I think not)
Can I use Subtotal instead? without using an auxiliary column neither.

Any suggestions?

Please, I do not want to use D as an intermediary column for the
result of B*C

Thank you in advance