Ratio of growth over a filtered set

G

Guest

Assume the following sheet, with columns titles Color, Yesterday, Today

Blue 5 7
Blue 0 9
Red 3 9

It is filtered using an autofilter on Color, and I need to show the total
for Today, but I need to exclude rows with a 0 value in the Yesterday column.

For instance, when filtered on Blue, I need to get 7

I realize I can use SUBTOTAL to get the sum of the C column across the
filtered rows, how do I exclude rows with a 0 value in column B from the
SUBTOTAL ?
 
D

Domenic

Assuming that A2:C4 contains the data, try...

=SUMPRODUCT(--($B$2:$B4<>0),SUBTOTAL(9,OFFSET($C$2:$C$4,ROW($C$2:$C$4)-RO
W($C$2),0,1)))

Hope this helps!
 
G

Guest

Yes, it works. I wish I would understand it though. Where can I find a
description of what "--" does ?

Many thanks.
 

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