Subtotal positive and negative values on visible rows

Cowichandave

New Member
Joined
Jan 18, 2009
Messages
47
Office Version
  1. 2016
Not sure what works. Totals have to work with visible rows only as filters are actively changed
Column A must total only negative values in column C which would equal -121.15
Column D must total only positive values in column C which would equal 170.75
Colum C total contains column c combined total which equal 49.60

In other words Column A and D separate the values in Column C and total them separately.

Any help with a solution would be great. I tried using subtotal which works great with visible rows But I do not know how to separate the positive and negative values into totals


ABCDE
Total Negative Total Total Positive
-121.15 49.60 170.75
44.50
-24.45
61.00
65.25
-64.50
-32.20
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
In A2
Excel Formula:
=SUMIF(C2:C8,"<0")
In E2
Excel Formula:
=SUMIF(C2:C8,">0")
 
Upvote 0
Not sure what works. Totals have to work with visible rows only as filters are actively changed
Column A must total only negative values in column C which would equal -121.15
Column D must total only positive values in column C which would equal 170.75
Colum C total contains column c combined total which equal 49.60

In other words Column A and D separate the values in Column C and total them separately.

Any help with a solution would be great. I tried using subtotal which works great with visible rows But I do not know how to separate the positive and negative values into totals


ABCDE
Total NegativeTotalTotal Positive
-121.15 49.60 170.75
44.50
-24.45
61.00
65.25
-64.50
-32.20
 
Upvote 0
That sums the entire column. Now if filters are turned on, I want it total the visible rows only like how subtotal works
 
Upvote 0
One pretty easy way would be to use a helper column. I have used column G and whatever column it is could be hidden. Formulas are then pointed at that helper column.
I have included a simpler alternative for the negative sum in A2
Unfiltered it could look like this

24 11 06.xlsm
ABCDEFG
1Total NegativeTotalTotal Positive
2-121.1549.6170.75
3-121.15HeaderHelper
444.544.5
5-24.45-24.45
66161
765.2565.25
8-64.5-64.5
9-32.2-32.2
Sum Filtered
Cell Formulas
RangeFormula
C2C2=SUM(G4:G9)
E2E2=SUMIF(G4:G9,">0")
A2A2=SUMIF(G4:G9,"<0")
A3A3=C2-E2
G4:G9G4=SUBTOTAL(103,C4)*C4


Now filter the original column C

24 11 06.xlsm
ABCDEFG
1Total NegativeTotalTotal Positive
2-32.273.3105.5
3-32.2HeaderHelper
444.544.5
66161
9-32.2-32.2
Sum Filtered
Cell Formulas
RangeFormula
C2C2=SUM(G4:G9)
E2E2=SUMIF(G4:G9,">0")
A2A2=SUMIF(G4:G9,"<0")
A3A3=C2-E2
G4,G6,G9G4=SUBTOTAL(103,C4)*C4
 
Last edited:
Upvote 0
That sums the entire column. Now if filters are turned on, I want it total the visible rows only like how subtotal works

That totals only positive or negative numbers contained in the column. BTW the total of positive numbers is 220.35 not 170..75...
Also
Excel Formula:
=AGGREGATE(9,5,C2:C8) is an option
 
Upvote 0

Forum statistics

Threads
1,223,941
Messages
6,175,537
Members
452,652
Latest member
eduedu

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