Excel SUM and SUBTOTAL in a filtered list

MYUSERNAMEIS

New Member
Joined
Jan 4, 2017
Messages
4
Hello,
Please can you help me with working out a formula.

I want a formula that will total the unique supplier postage costs even if the data has been filtered by another column (In the example - COLUMN D)
i have tried various different formula found on here but none of them seem to do what i need. (combinations of COUNTIF, SUM, SUBTOTAL, FREQUENCY, MATCH)

1 A B C D
2Item Supplier Postage
3scissorsCompany A£1.00
4tablesCompany B£15.00 hidden
5paperCompany B£15.00
6pensCompany A£1.00
7tapeCompany C£0.50
8pencilsCompany D£0.00
9
10£16.50

<tbody>
</tbody>

If the formula did what I wanted it to do the result in C:10 would be £16.50
There are many more rows and columns with other formulas to take into account. It also has to be a result that is just visible, without the end user having to do anything - so i don't think a pivot table.

I am also a complete novice at Excel so would also appreciate if you could explain what the different bits in the formula actually do.
if anybody could help or point me in the right direction i would be so greatful!
myusernameis
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Try the following formula, which needs to be confirmed with CONTROL+SHIFT+ENTER...

=SUM(IF(FREQUENCY(IF(SUBTOTAL(3,OFFSET(C3:C8,ROW(C3:C8)-ROW(C3),0,1))>0,MATCH(C3:C8,C3:C8,0)),ROW(C3:C8)-ROW(C3)+1)>0,D3:D8))

Also, to take into account both filtered and manually hidden rows, replace 3 in red with 103.

Hope this helps!
 
Upvote 0
Thank you so much Domenic.
This does exactly what I want it to. I've been wrestling with this for weeks hoping to eventually stumble on the correct combination - I was nowhere near this - again thank you so much!
 
Upvote 0
You're very welcome. Glad I could help.

Cheers!
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,680
Members
449,116
Latest member
HypnoFant

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top