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)

[TABLE="class: grid, width: 338"]
<tbody>[TR]
[TD]1[/TD]
[TD] A[/TD]
[TD] B[/TD]
[TD] C [/TD]
[TD] D[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Item[/TD]
[TD] Supplier[/TD]
[TD] Postage[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]scissors[/TD]
[TD]Company A[/TD]
[TD="align: right"]£1.00[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]tables[/TD]
[TD]Company B[/TD]
[TD="align: right"]£15.00[/TD]
[TD] hidden[/TD]
[/TR]
[TR]
[TD] 5[/TD]
[TD]paper[/TD]
[TD]Company B[/TD]
[TD="align: right"]£15.00[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]pens[/TD]
[TD]Company A[/TD]
[TD="align: right"]£1.00[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]tape[/TD]
[TD]Company C[/TD]
[TD="align: right"]£0.50[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]pencils[/TD]
[TD]Company D[/TD]
[TD="align: right"]£0.00[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD][/TD]
[TD][/TD]
[TD]£16.50[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

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

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
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

Forum statistics

Threads
1,224,827
Messages
6,181,194
Members
453,021
Latest member
pingpong7117

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