Subtotal and running/cumulative total!

rahul25

New Member
Joined
Nov 18, 2005
Messages
8
Loacation Name Sales Comm
252 ABC 100 12.5
252 CCC 100 12.5
252 DDD 100 12.5
300 EEE 100 12.5
300 FFF 100 12.5
500 GGG 100 12.5
500 HHH 100 12.5
500 KKK 100 12.5

Is there any way to get the subtotal and running/cumulative total in each change of location number as under:

Loacation Name Sales Comm
252 ABC 100 12.5
252 CCC 100 12.5
252 DDD 100 12.5
252 total
Cum total
300 EEE 100 12.5
300 FFF 100 12.5
252 total
Cum total
500 GGG 100 12.5
500 HHH 100 12.5
500 KKK 100 12.5
252 total
Cum total
Grand Total
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
G2 copied down
=SUMPRODUCT(--($A$2:$A$9=F2),$D$2:$D$9)

H2 copied down
=SUM($G$2:G2)


Ihope this gets you started
Book1
ABCDEFGH
1SUBRUNNING
2252ABC10012.525237.537.5
3252CCC10012.53002562.5
4252DDD10012.550037.5100
5300EEE10012.5
6300FFF10012.5
7500GGG10012.5
8500HHH10012.5
9500KKK10012.5
Sheet1
 
Upvote 0
Sorry I forgot to mention that I need VBA code which will give me subtotal and running total just in the rows within data area not somewhere else.
 
Upvote 0
Yes, that certainly would have been useful information...has to be code?

There are many alternative means via formula, pivot table, or even using the subtotal function....
 
Upvote 0
Gibbs said:
G2 copied down
=SUMPRODUCT(--($A$2:$A$9=F2),$D$2:$D$9)

H2 copied down
=SUM($G$2:G2)


...

Whenever there is a single condition, the faster SumIf will suffice:

=SUMIF($A$2:$A$9,F2,$D$2:$D$9)
 
Upvote 0

Forum statistics

Threads
1,214,991
Messages
6,122,628
Members
449,095
Latest member
bsb1122

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