Running total

ZerglingPack

New Member
Joined
May 11, 2018
Messages
6
I've been tasked with creating a spread sheet that will show a running total, but I'm not sure where to start.
[TABLE="width: 500, align: center"]
<tbody>[TR]
[TD]Amount[/TD]
[TD]Total[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]x[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]x[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]18[/TD]
[/TR]
</tbody>[/TABLE]

It started out simple enough, enter amounts on the left and a cell on the right would show the total. My problem is that the boss wants to be able to put an X (or any simple way) and it would total the numbers after the previous X. The big issue is that the "amount" column doesn't have a specific amount of cells before needing a total. It could be as few as two amounts or up to fifty before the next X. Any suggestions or solutions would be greatly appreciated.
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
NVM I'm blind. Thank you very much Steve! Do you know how I could make it so the totals are directly under each other instead of spaced out?
 
Upvote 0
I cant think of a way to do that. There may be one but not one that immediately springs to mind using formulas.
 
Upvote 0
Actually this array formula should work. Enter it CTRL-SHIFT-ENTER not just ENTER. In B2 and copy down:

=IFERROR(SUM($A$1:INDEX($A$1:$A$1000,SMALL(IF($A$2:$A$1000="x",ROW($A$2:$A$1000)),ROWS($A$1:A1))))-SUM($B$1:B1),"")
 
Upvote 0
Actually this array formula should work. Enter it CTRL-SHIFT-ENTER not just ENTER. In B2 and copy down:

=IFERROR(SUM($A$1:INDEX($A$1:$A$1000,SMALL(IF($A$2:$A$1000="x",ROW($A$2:$A$1000)),ROWS($A$1:A1))))-SUM($B$1:B1),"")



This is exactly what I am looking for, you are amazing! I'm not even sure what the formula means, but it's doing exactly what my boss wants. Thank you for everything.
 
Upvote 0
Would this non-array formula achieve your target? Assuming your numbers in column A & the totals should appear in column B

=IF(A2="x",SUM($A$1:A2)-SUM($B$1:B1),"")
 
Upvote 0
MSE330 that was close to what I was looking for, but the Array that Steve posted was nearly exactly what I thought the boss wanted. Is it possible to have the numbers between the X added to the next set? Basically he wanted the X as a quick way of moving the information to another cell, but the amounts between each x should be added to the previous set of numbers. Is that possible?
 
Upvote 0
I was able to figure it out, I just removed -sum, but now my question is how would I add multiple columns for the numbers I input? The total would still be in one column, but lets say I wanted to input numbers in column A and B with the total moving to C.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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