How do you subtotal a sum?

rizzo93

Active Member
Joined
Jan 22, 2015
Messages
299
Office Version
  1. 365
When I filter a table, I have this formula to tell me how many rows are being displayed as a result of the filtering:


Code:
SUBTOTAL(102,PeriTable[ID])
I now need to do something similar for another column, but in this case I am totaling the numbers contained in these cells. As I filter the table, I need this total to take into account the cells that are being filtered out.


How can I achieve this please?
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Last edited:
Upvote 0
Sure, here's a basic example:


Date

Product
Qty
4/15/2019
apple

1
4/15/2019
orange
5
4/15/2019
grape
2
4/15/2019
mango
2
4/15/2019
banana
7
2/17/2019
apple
1
2/17/2019
orange
1
2/17/2019
grape
9
2/17/2019
mango
8
2/17/2019

banana
2


<tbody>
</tbody>


So we have 10 rows. The sum total comes to 38.

Using the formula I initially provided, it will yield a number of 10 rows. If I filter on just 4/15/2019, that formula will yield 5 rows. All is good to this point.

My goal is to have the sum total change along with the filter. So in this example above, it should show 17.
 
Upvote 0
You can use the same formula, but use 109 instead of 102
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,394
Members
448,957
Latest member
Hat4Life

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