View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default How to sumproduct only filtered data

Thanks!

Let's see if that's what the OP had in mind.

--
Biff
Microsoft Excel MVP


"Sheeloo" wrote in message
...
Very creative. Hats off to you.

"T. Valko" wrote:

Here's an example...

A1:C1 = column headers

A1 = Region
B1 = Quantity
C1 = Price

A2:A20 = regions = North, East, South, West. Each appears multiple times
B2:C20 = numeric values

Assume you filter on column A = West

This will give you the sum total of Quantity * Price for West:

=SUMPRODUCT(SUBTOTAL(3,OFFSET(A2:A20,ROW(A2:A20)-ROW(A2),0,1)),B2:B20,C2:C20)

--
Biff
Microsoft Excel MVP


"Niclas" wrote in message
...
I have simplified the problem when writing. My worksheet contains about
130
colums, where I need to do the same thing. And due to other column
data, I
actually only have 4 unused colums, so the suggested workaround is not
going
to work. I might then copy some of the data to other worksheets, but I
rather
not at least not as long as there is still hope. Splitting the data
will
provide other problems for some of the statistical analyses.

Niclas

"Sheeloo" skrev:

One workaround would be to introduce a third column with the formula
in
C2;
=A2*B2

then use SUBTOTAL(9, your_range) function on Col C


"Niclas" wrote:

The excel sheet/tables contains data from a survey. So I basicly
need
to
filter in a lot of different ways, and will only be interested in
the
sumproduct of the rows that remains after filtering. At this point
the
the
formular also includes the non-visible rows. I am not sure this
answers
your
question, but hopefully it does.

Niclas

"T. Valko" skrev:

OK, so what is the condition that you want the sum of?

--
Biff
Microsoft Excel MVP


"Niclas" wrote in message
...
Hi,

I have two tables a2:a100 and b2:b100. I am using the formular
=SUMPRODUKT(A2:A100;B2:B100) to arrive at a total sum, after
each
row is
first multiplied (a2*b2 ...a100*b100). This appears to work
fine.

However, once I filter the data, the SUMPRODUCT continues to
include all
rows rather than just those appearing after the filtering. I
have
read
through a lot of the Q&A's on this page, but still can't get it
to
work.

Thus, I would be grateful for your help.
Thanks,
Niclas