How to subtotal filtered and unfiltered cells?

288enzo

Well-known Member
Joined
Feb 8, 2009
Messages
721
Office Version
  1. 2016
Platform
  1. Windows
Hi all

I'm trying to do something that I'm starting to think can't be done.

I'm trying to filter Table1 by category and update the subtotals above. The subtotal for the specific filtered category works as it should using subtotal 109, however what I can't figure out is how to subtotal multiple categories regardless if any category is actually filtered. One note is my table is ever growing, so I wouldn't be able to lock in a specific range.

Thank you

QQQ (1) (version 1).xlsb
AB
1Subtotal Red & Green
2Filtered Subtotal51
3
4CategoryAmount
5Green4
6Red6
7Blue5
8Green8
9Blue3
10Blue7
11Red9
12Green2
13Blue5
14Green2
Sheet1
Cell Formulas
RangeFormula
B2B2=SUBTOTAL(109,Table1[Amount])
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
I am not sure if I understand your requirement 100%. However, if you want Excel to ignore any filter that you have applied to your data and total everything, use SUM formula. On the other hand, if you want to add only visible rows, use SUBTOTAL formula which will ignore hidden rows.

Kind regards

Saba
 
Upvote 0
I am not sure if I understand your requirement 100%. However, if you want Excel to ignore any filter that you have applied to your data and total everything, use SUM formula. On the other hand, if you want to add only visible rows, use SUBTOTAL formula which will ignore hidden rows.

Kind regards

Saba
I'm looking for something in the middle. I want the filtered results to show the subtotal, this works. But at the same time I'd also like to always show the total of the Red and Green values. I started to think I could have a separate sheet that would list all Red and Green values using INDEX (just started reading into it) then the total could be pulled from that second sheet. I hope that helps. Thank you.
 
Upvote 0
you can use sumifs and sum as demonstrated below.

1612825959763.png



Enter the categories you want to total irrespective of these rows are filtered or not in D12 to D13.


Enter the following formula in B12

=SUM(SUMIFS($B$2:$B$9,$A$2:$A$9,D12:D13))

you can see the result below.

1612826100480.png


Kind regards

Saba
 
Upvote 0
Hi Saba - thank you for the help, but when I tried what you did I get zero. I'm not sure what I'm doing that's different. Could it be because my data is in a table? I tried to swap out the cell references with the table references, but that didn't work either. Thanks.

QQQ (1) (version 1).xlsb
AB
1Filtered Subtotal51
2
3CategoryAmount
4Green4
5Red6
6Blue5
7Green8
8Blue3
9Blue7
10Red9
11Green2
12Blue5
13Green2
14
15Subtotal for:0
16Green
17Red
Sheet1
Cell Formulas
RangeFormula
B1B1=SUBTOTAL(109,Table1[Amount])
B15B15=SUM(SUMIFS($B$4:$B$13,$A$4:$A$13,A16:A17))
 
Upvote 0
Hi

I used 365 to solve this problem. I think that you have different version of Excel.

if so, please enter your formula as array by pressing Shift + Control + Enter.

=SUM(SUMIFS($B$4:$B$13,$A$4:$A$13,A16:A17))

it should work as I tested using excel 2010
 
Upvote 0
Solution
Hi

I used 365 to solve this problem. I think that you have different version of Excel.

if so, please enter your formula as array by pressing Shift + Control + Enter.

=SUM(SUMIFS($B$4:$B$13,$A$4:$A$13,A16:A17))

it should work as I tested using excel 2010

That was the trick, thank you very much.
 
Upvote 0

Forum statistics

Threads
1,214,867
Messages
6,122,002
Members
449,059
Latest member
mtsheetz

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