Please Help. How to restart running total if given condition is satisfied

rival36

New Member
Joined
May 31, 2019
Messages
41
Office Version
  1. 2016
Platform
  1. Windows
Dear all, I am Stuck in this. Please Help

I want to restart the running total of column 'A' in column 'B' if the value in condition column 'C' is more than 0. the required result is shown in objective column 'D'

[TABLE="width: 532"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]Data[/TD]
[TD]Runnnin TOTAL[/TD]
[TD]CONDITION[/TD]
[TD]Objective[/TD]
[/TR]
[TR]
[TD]111[/TD]
[TD]111[/TD]
[TD]0[/TD]
[TD]111[/TD]
[/TR]
[TR]
[TD]255[/TD]
[TD]366[/TD]
[TD]0[/TD]
[TD]366[/TD]
[/TR]
[TR]
[TD]212[/TD]
[TD]578[/TD]
[TD]0[/TD]
[TD]578[/TD]
[/TR]
[TR]
[TD]13285.8[/TD]
[TD]13863.8[/TD]
[TD]0[/TD]
[TD]13863.8[/TD]
[/TR]
[TR]
[TD]9341.25[/TD]
[TD]23205.05[/TD]
[TD]0[/TD]
[TD]23205.05[/TD]
[/TR]
[TR]
[TD]5539.55[/TD]
[TD]28744.6[/TD]
[TD]0[/TD]
[TD]28744.6[/TD]
[/TR]
[TR]
[TD]10808.75[/TD]
[TD]39553.35[/TD]
[TD]0[/TD]
[TD]39553.35[/TD]
[/TR]
[TR]
[TD]2186.4[/TD]
[TD]41739.75[/TD]
[TD]974.38375[/TD]
[TD]2186.4[/TD]
[/TR]
[TR]
[TD]2269.8[/TD]
[TD]44009.55[/TD]
[TD]0[/TD]
[TD]4456.2[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]44009.55[/TD]
[TD]0[/TD]
[TD]4456.2[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]44009.55[/TD]
[TD]0[/TD]
[TD]4456.2[/TD]
[/TR]
[TR]
[TD]9603.5[/TD]
[TD]53613.05[/TD]
[TD]0[/TD]
[TD]14059.7[/TD]
[/TR]
[TR]
[TD]11649.2[/TD]
[TD]65262.25[/TD]
[TD]0[/TD]
[TD]25708.9[/TD]
[/TR]
[TR]
[TD]5610.6[/TD]
[TD]70872.85[/TD]
[TD]0[/TD]
[TD]31319.5[/TD]
[/TR]
[TR]
[TD]2241[/TD]
[TD]73113.85[/TD]
[TD]671.5825[/TD]
[TD]2241[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]73113.85[/TD]
[TD]0[/TD]
[TD]2241[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]73113.85[/TD]
[TD]0[/TD]
[TD]2241[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]73113.85[/TD]
[TD]0[/TD]
[TD]2241[/TD]
[/TR]
[TR]
[TD]6224.75[/TD]
[TD]79338.6[/TD]
[TD]0[/TD]
[TD]8465.75[/TD]
[/TR]
[TR]
[TD]2563.4[/TD]
[TD]81902[/TD]
[TD]0[/TD]
[TD]11029.15[/TD]
[/TR]
[TR]
[TD]6395.75[/TD]
[TD]88297.75[/TD]
[TD]0[/TD]
[TD]17424.9[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]88297.75[/TD]
[TD]0[/TD]
[TD]17424.9[/TD]
[/TR]
[TR]
[TD]12904.35[/TD]
[TD]101202.1[/TD]
[TD]435.6225[/TD]
[TD]12904.35[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]101202.1[/TD]
[TD]0[/TD]
[TD]12904.35[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]101202.1[/TD]
[TD]0[/TD]
[TD]12904.35[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]101202.1[/TD]
[TD]0[/TD]
[TD]12904.35[/TD]
[/TR]
[TR]
[TD]6881.85[/TD]
[TD]108083.95[/TD]
[TD]0[/TD]
[TD]19786.2[/TD]
[/TR]
[TR]
[TD]13545.2[/TD]
[TD]121629.15[/TD]
[TD]0[/TD]
[TD]33331.4[/TD]
[/TR]
[TR]
[TD]555554[/TD]
[TD]677183.15[/TD]
[TD]510.67625[/TD]
[TD]555554[/TD]
[/TR]
[TR]
[TD]13571.4[/TD]
[TD]690754.55[/TD]
[TD]0[/TD]
[TD]569125.4[/TD]
[/TR]
[TR]
[TD]6490[/TD]
[TD]697244.55[/TD]
[TD]0[/TD]
[TD]575615.4[/TD]
[/TR]
[TR]
[TD]12527.9[/TD]
[TD]709772.45[/TD]
[TD]0[/TD]
[TD]588143.3[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]709772.45[/TD]
[TD]0[/TD]
[TD]588143.3[/TD]
[/TR]
[TR]
[TD]12758.2[/TD]
[TD]722530.65[/TD]
[TD]0[/TD]
[TD]600901.5[/TD]
[/TR]
[TR]
[TD]12358.3[/TD]
[TD]734888.95[/TD]
[TD]0[/TD]
[TD]613259.8[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]734888.95[/TD]
[TD]0[/TD]
[TD]613259.8[/TD]
[/TR]
[TR]
[TD]6311.75[/TD]
[TD]741200.7[/TD]
[TD]0[/TD]
[TD]619571.55[/TD]
[/TR]
[TR]
[TD]6273.8[/TD]
[TD]747474.5[/TD]
[TD]0[/TD]
[TD]625845.35[/TD]
[/TR]
[TR]
[TD]12416.15[/TD]
[TD]759890.65[/TD]
[TD]0[/TD]
[TD]638261.5[/TD]
[/TR]
[TR]
[TD]12109.75[/TD]
[TD]772000.4[/TD]
[TD]0[/TD]
[TD]650371.25[/TD]
[/TR]
[TR]
[TD]11766.85[/TD]
[TD]783767.25[/TD]
[TD]0[/TD]
[TD]662138.1[/TD]
[/TR]
[TR]
[TD]11557.05[/TD]
[TD]795324.3[/TD]
[TD]0[/TD]
[TD]673695.15[/TD]
[/TR]
[TR]
[TD]11389.5[/TD]
[TD]806713.8[/TD]
[TD]0[/TD]
[TD]685084.65[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]806713.8[/TD]
[TD]0[/TD]
[TD]685084.65[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]806713.8[/TD]
[TD]0[/TD]
[TD]685084.65[/TD]
[/TR]
[TR]
[TD]54554[/TD]
[TD]861267.8[/TD]
[TD]3238.26625[/TD]
[TD]54554[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]861269.8[/TD]
[TD]0[/TD]
[TD]54556[/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD]861281.8[/TD]
[TD]0[/TD]
[TD]54568[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]861281.8[/TD]
[TD]0[/TD]
[TD]54568[/TD]
[/TR]
[TR]
[TD]2657[/TD]
[TD]863938.8[/TD]
[TD]0[/TD]
[TD]57225[/TD]
[/TR]
[TR]
[TD]2647.9[/TD]
[TD]866586.7[/TD]
[TD]0[/TD]
[TD]59872.9[/TD]
[/TR]
[TR]
[TD]58884[/TD]
[TD]925470.7[/TD]
[TD]132.6225[/TD]
[TD]58884[/TD]
[/TR]
[TR]
[TD]46[/TD]
[TD]925516.7[/TD]
[TD]0[/TD]
[TD]58930[/TD]
[/TR]
[TR]
[TD]312[/TD]
[TD]925828.7[/TD]
[TD]0[/TD]
[TD]59242[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]925828.7[/TD]
[TD]0[/TD]
[TD]59242[/TD]
[/TR]
[TR]
[TD]3071.1[/TD]
[TD]928899.8[/TD]
[TD]0[/TD]
[TD]62313.1[/TD]
[/TR]
[TR]
[TD]12203.25[/TD]
[TD]941103.05[/TD]
[TD]0[/TD]
[TD]74516.35[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]941103.05[/TD]
[TD]0[/TD]
[TD]74516.35[/TD]
[/TR]
[TR]
[TD]15089.65[/TD]
[TD]956192.7[/TD]
[TD]381.85875[/TD]
[TD]15089.65[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]956192.7[/TD]
[TD]0[/TD]
[TD]15089.65[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]956192.7[/TD]
[TD]0[/TD]
[TD]15089.65[/TD]
[/TR]
[TR]
[TD]16412.15[/TD]
[TD]972604.85[/TD]
[TD]0[/TD]
[TD]31501.8[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]972604.85[/TD]
[TD]0[/TD]
[TD]31501.8[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]972604.85[/TD]
[TD]0[/TD]
[TD]31501.8[/TD]
[/TR]
[TR]
[TD]3473.4[/TD]
[TD]976078.25[/TD]
[TD]0[/TD]
[TD]34975.2[/TD]
[/TR]
[TR]
[TD]8761.35[/TD]
[TD]984839.6[/TD]
[TD]0[/TD]
[TD]43736.55[/TD]
[/TR]
[TR]
[TD]8667.45[/TD]
[TD]993507.05[/TD]
[TD]0[/TD]
[TD]52404[/TD]
[/TR]
[TR]
[TD]8573.05[/TD]
[TD]1002080.1[/TD]
[TD]0[/TD]
[TD]60977.05[/TD]
[/TR]
[TR]
[TD]8479.7[/TD]
[TD]1010559.8[/TD]
[TD]1524.42625[/TD]
[TD]8479.7[/TD]
[/TR]
[TR]
[TD]3383.4[/TD]
[TD]1013943.2[/TD]
[TD]0[/TD]
[TD]11863.1[/TD]
[/TR]
[TR]
[TD]4445[/TD]
[TD]1018388.2[/TD]
[TD]296.5775[/TD]
[TD]4445[/TD]
[/TR]
[TR]
[TD]55[/TD]
[TD]1018443.2[/TD]
[TD]0[/TD]
[TD]4500[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]1018443.2[/TD]
[TD]0[/TD]
[TD]4500[/TD]
[/TR]
[TR]
[TD]17532.5[/TD]
[TD]1035975.7[/TD]
[TD]0[/TD]
[TD]22032.5[/TD]
[/TR]
[TR]
[TD]3492.2[/TD]
[TD]1039467.9[/TD]
[TD]438.3125[/TD]
[TD]3492.2[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]1039467.9[/TD]
[TD]0[/TD]
[TD]3492.2[/TD]
[/TR]
[TR]
[TD]9234.9[/TD]
[TD]1048702.8[/TD]
[TD]0[/TD]
[TD]12727.1[/TD]
[/TR]
[TR]
[TD]5555[/TD]
[TD]1054257.8[/TD]
[TD]318.1775[/TD]
[TD]5555[/TD]
[/TR]
[TR]
[TD]9341.2[/TD]
[TD]1063599[/TD]
[TD]0[/TD]
[TD]14896.2[/TD]
[/TR]
[TR]
[TD]3778.1[/TD]
[TD]1067377.1[/TD]
[TD]233.53[/TD]
[TD]3778.1[/TD]
[/TR]
[TR]
[TD]18676.05[/TD]
[TD]1086053.15[/TD]
[TD]0[/TD]
[TD]22454.15[/TD]
[/TR]
[TR]
[TD]9270.7[/TD]
[TD]1095323.85[/TD]
[TD]561.35375[/TD]
[TD]9270.7[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]1095323.85[/TD]
[TD]0[/TD]
[TD]9270.7[/TD]
[/TR]
[TR]
[TD]18995.35[/TD]
[TD]1114319.2[/TD]
[TD]231.7675[/TD]
[TD]18995.35[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]1114319.2[/TD]
[TD]0[/TD]
[TD]18995.35[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]1114319.2[/TD]
[TD]0[/TD]
[TD]18995.35[/TD]
[/TR]
[TR]
[TD]4663.5[/TD]
[TD]1118982.7[/TD]
[TD]0[/TD]
[TD]23658.85[/TD]
[/TR]
[TR]
[TD]17490[/TD]
[TD]1136472.7[/TD]
[TD]0[/TD]
[TD]41148.85[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]1136472.7[/TD]
[TD]0[/TD]
[TD]41148.85[/TD]
[/TR]
[TR]
[TD]21448.8[/TD]
[TD]1157921.5[/TD]
[TD]0[/TD]
[TD]62597.65[/TD]
[/TR]
[TR]
[TD]10546.55[/TD]
[TD]1168468.05[/TD]
[TD]0[/TD]
[TD]73144.2[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]1168468.05[/TD]
[TD]0[/TD]
[TD]73144.2[/TD]
[/TR]
[TR]
[TD]21443.75[/TD]
[TD]1189911.8[/TD]
[TD]0[/TD]
[TD]94587.95[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]1189911.8[/TD]
[TD]0[/TD]
[TD]94587.95[/TD]
[/TR]
[TR]
[TD]55555[/TD]
[TD]1245466.8[/TD]
[TD]1889.815[/TD]
[TD]55555[/TD]
[/TR]
[TR]
[TD]2222[/TD]
[TD]1247688.8[/TD]
[TD]0[/TD]
[TD]57777[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]1247688.8[/TD]
[TD]0[/TD]
[TD]57777[/TD]
[/TR]
[TR]
[TD]22468.25[/TD]
[TD]1270157.05[/TD]
[TD]0[/TD]
[TD]80245.25[/TD]
[/TR]
[TR]
[TD]4475.4[/TD]
[TD]1274632.45[/TD]
[TD]561.70625[/TD]
[TD]4475.4[/TD]
[/TR]
[TR]
[TD]22168.75[/TD]
[TD]1296801.2[/TD]
[TD]0[/TD]
[TD]26644.15[/TD]
[/TR]
[TR]
[TD]4389.1[/TD]
[TD]1301190.3[/TD]
[TD]666.10375[/TD]
[TD]4389.1[/TD]
[/TR]
[TR]
[TD]10979.3[/TD]
[TD]1312169.6[/TD]
[TD]0[/TD]
[TD]15368.4[/TD]
[/TR]
[TR]
[TD]10915.5[/TD]
[TD]1323085.1[/TD]
[TD]0[/TD]
[TD]26283.9[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]1323085.1[/TD]
[TD]0[/TD]
[TD]26283.9[/TD]
[/TR]
[TR]
[TD]11451.15[/TD]
[TD]1334536.25[/TD]
[TD]0[/TD]
[TD]37735.05[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]1334536.25[/TD]
[TD]0[/TD]
[TD]37735.05[/TD]
[/TR]
[TR]
[TD]22975.85[/TD]
[TD]1357512.1[/TD]
[TD]559.16625[/TD]
[TD]22975.85[/TD]
[/TR]
[TR]
[TD]17214.15[/TD]
[TD]1374726.25[/TD]
[TD]0[/TD]
[TD]40190[/TD]
[/TR]
[TR]
[TD]21176.45[/TD]
[TD]1395902.7[/TD]
[TD]0[/TD]
[TD]61366.45[/TD]
[/TR]
[TR]
[TD]16189.05[/TD]
[TD]1412091.75[/TD]
[TD]0[/TD]
[TD]77555.5[/TD]
[/TR]
[TR]
[TD]9998[/TD]
[TD]1422089.75[/TD]
[TD]0[/TD]
[TD]87553.5[/TD]
[/TR]
[TR]
[TD]19731.55[/TD]
[TD]1441821.3[/TD]
[TD]0[/TD]
[TD]107285.05[/TD]
[/TR]
[TR]
[TD]19299.75[/TD]
[TD]1461121.05[/TD]
[TD]0[/TD]
[TD]126584.8[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]1461121.05[/TD]
[TD]0[/TD]
[TD]126584.8[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]1461121.05[/TD]
[TD]0[/TD]
[TD]126584.8[/TD]
[/TR]
[TR]
[TD]20008.95[/TD]
[TD]1481130[/TD]
[TD]0[/TD]
[TD]146593.75[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]1481130[/TD]
[TD]0[/TD]
[TD]146593.75[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]1481130[/TD]
[TD]0[/TD]
[TD]146593.75[/TD]
[/TR]
[TR]
[TD]4110.3[/TD]
[TD]1485240.3
[/TD]
[TD]0[/TD]
[TD]150704.05[/TD]
[/TR]
[TR]
[TD]20037.6[/TD]
[TD]1505277.9[/TD]
[TD]0[/TD]
[TD]170741.65[/TD]
[/TR]
[TR]
[TD]4035.4[/TD]
[TD]1509313.3[/TD]
[TD]4268.54125[/TD]
[TD]4035.4[/TD]
[/TR]
[TR]
[TD]9992.15[/TD]
[TD]1519305.45[/TD]
[TD]0[/TD]
[TD]14027.55[/TD]
[/TR]
[TR]
[TD]19725.8[/TD]
[TD]1539031.25[/TD]
[TD]0[/TD]
[TD]33753.35[/TD]
[/TR]
[TR]
[TD]14795.4[/TD]
[TD]1553826.65[/TD]
[TD]0
[/TD]
[TD]48548.75[/TD]
[/TR]
[TR]
[TD]18183.95[/TD]
[TD]1572010.6[/TD]
[TD]0[/TD]
[TD]66732.7[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]1572010.6[/TD]
[TD]0[/TD]
[TD]66732.7[/TD]
[/TR]
[TR]
[TD]18226.9[/TD]
[TD]1590237.5[/TD]
[TD]0[/TD]
[TD]84959.6[/TD]
[/TR]
[TR]
[TD]13872.75[/TD]
[TD]1604110.25[/TD]
[TD]0[/TD]
[TD]98832.35[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]1604110.25[/TD]
[TD]0[/TD]
[TD]98832.35[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]1604110.25[/TD]
[TD]0[/TD]
[TD]98832.35[/TD]
[/TR]
[TR]
[TD]2121[/TD]
[TD]1606231.25[/TD]
[TD]2470.80875[/TD]
[TD]2121[/TD]
[/TR]
[TR]
[TD]121[/TD]
[TD]1606352.25[/TD]
[TD]0
[/TD]
[TD]2242[/TD]
[/TR]
[TR]
[TD]455[/TD]
[TD]1606807.25[/TD]
[TD]0[/TD]
[TD]2697[/TD]
[/TR]
[TR]
[TD]888888[/TD]
[TD]2495695.25[/TD]
[TD]0[/TD]
[TD]891585
[/TD]
[/TR]
</tbody>[/TABLE]


THANKS A LOT
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
try this in D2 and copy down

Code:
=SUM($A$2:A2)-IFERROR(SUM(OFFSET($A$1,1,0,MATCH(LOOKUP(2,1/($C$2:C2>0),$C$2:C2),$C$2:C2,0)-1,1)),0)
 
Upvote 0
Cross posted https://www.excelforum.com/excel-ge...ng-total-if-given-condition-is-satisfied.html

While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules).
This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 
Upvote 0
thanks a loot AlanY;5286155 u just saved my life... it worked..:)
 
Upvote 0
try this in D2 and copy down

Code:
=SUM($A$2:A2)-IFERROR(SUM(OFFSET($A$1,1,0,MATCH(LOOKUP(2,1/($C$2:C2>0),$C$2:C2),$C$2:C2,0)-1,1)),0)
Alan I need one more help. You Solved me a Conditional Formula Problem Previously. It worked great. I am stuck in new one! Please help.
Please refer to attached image. I want following result:
If C5 is greater than zero Put B6=A5, Otherwise Return B6= Value in Cell A Whenever Cell C has number greater than Zero Previously.

Want This Result
ABCABC
541542
101540
5450545540
45045540
515541
7827852
80080780
404780
87187784
505870
414876
Waiting for your reply..
 

Attachments

  • Untitled.png
    Untitled.png
    28.4 KB · Views: 11
Upvote 0
@rival36
You have already been warned about crossposting in this thread, yet you have ignored that & cross posted again without supplying a link.
Please supply all link(s). Thanks
 
Upvote 0
try this in D2 and copy down

Code:
=SUM($A$2:A2)-IFERROR(SUM(OFFSET($A$1,1,0,MATCH(LOOKUP(2,1/($C$2:C2>0),$C$2:C2),$C$2:C2,0)-1,1)),0)
My thread link is below
 
Upvote 0
That is a link to you duplicate post on this board (which has now been closed).
You need to supply link(s) to the other site(s) where you have asked this question.
 
Upvote 0

Similar threads

Forum statistics

Threads
1,223,884
Messages
6,175,175
Members
452,615
Latest member
bogeys2birdies

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