Cumulative SUM & restart count on condition

CASiddall

New Member
Joined
Nov 23, 2018
Messages
3
Hi

I have a row in which i input values on a daily basis, and i need these values to be added, until i insert a 'x' in a cell which will reset the sum total, thereafter the cumulative sum will only be after the last cell containing an 'x'.

Assuming i have 365 Columns representing each day in the year, what formula (or macro) can i use in cell 366 that can add values (including blank cells) in a row, but only sum the values after the last cell containing an "x"


Is this possible?
Thanks
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Hi, welcome to the forum!

Are you looking for something like this?


Excel 2013/2016
ABCDEFGHIJKL
2153x1x3x156
3551xxx354517
451314519
5512x11
Sheet1
Cell Formulas
RangeFormula
L2=SUM(INDEX(A2:K2,IFERROR(LOOKUP(COLUMNS(A2:K2),COLUMN(A2:K2)-MIN(COLUMN(A2:K2))+1/(A2:K2="x")),1)):K2)
 
Upvote 0
Hi

Yes, this formula is exactly what I want, and it works 100% as intended, thank you very much for your assistance.

Best Regards
 
Upvote 0
Slightly different computation, using the post #2 representation...

Control+shift+enter, not just enter, and copy down

=IFERROR(SUM(INDEX(A2:K2,MATCH(9.99999999999999E+307,1/(A2:K2="x"))):K2),0)
 
Upvote 0

Forum statistics

Threads
1,223,714
Messages
6,174,044
Members
452,542
Latest member
Bricklin

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