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
 

Some videos you may like

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

XLGibbs

Well-known Member
Joined
Feb 25, 2005
Messages
2,446
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
 

rahul25

New Member
Joined
Nov 18, 2005
Messages
8
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.
 

XLGibbs

Well-known Member
Joined
Feb 25, 2005
Messages
2,446
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....
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,201
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)
 

Watch MrExcel Video

Forum statistics

Threads
1,118,226
Messages
5,570,990
Members
412,353
Latest member
SofiaV
Top