Forum Discussion
Looking for Cumulative Sum Formula that returns Dynamic Arrays (i.e. spill-able)
Hello,
Thanks for looking at my post. But unfortunately, this formula does not spill.
Making it spillable is what makes this particular formula exercise tricky ๐
I'm not sure if there is a good way to do this without using Lambda (which I currently do not have an access for)
It is spill, please check attached. If you change spill in B2 formula follows it.
If you may do something without lamdas, do it. Lambdas in Excel are at very beginning, if you do something using them now, in few months most probably it could be done much easier. Also with lambdas. IMHO, using lambdas now is only to train the brains and be prepared to future Excel.
- mlylylyOct 21, 2022Copper Contributor
This is a great solution!
Sorry to ask additional questions in an old thread but is there a solution where the Dynamic Array (spill) is included in the cumulative sum formula?
My spill formula is P4=INDEX(SORTBY(B4:C8,B4:B8,1),,2), where the cumulative formula is
=LET(s, P4#, k, SEQUENCE(ROWS(s)), SUBTOTAL(9,OFFSET(s,0,0,k)))
However, I would like to have a formula corresponding to
LET(s, INDEX(SORTBY(B4:C8,B4:B8,1),,2), k, SEQUENCE(ROWS(s)), SUBTOTAL(9,OFFSET(s,0,0,k)))
This does not work because the OFFSET() does not reference a cell - is there a way to solve this?
Thanks a lot!
- SergeiBaklanOct 21, 2022Diamond Contributor
- mlylylyOct 21, 2022Copper Contributor
Appreciate the quick response!
I donโt have the SCAN() function, it is a corporate version so donโt think I will be able to update excel to get access? Is there another solution than SCAN()?
thanks!
- PapaAustinApr 30, 2021Copper Contributor
Hello Sergei,
I was replying to another commenter (his solution was using Sum(index... :index) approach which does not spill.
Yours look like it would spill as you pointed out.
I do not have an access to the latest O365 update with Let and Lambda features (I'm on an enterprise license and probably won't have those features until much later); I tried your file but it gives me #name error because my Excel doesn't know what Let() is.
So far, i have found this approach; it is rather a lengthy formula but it works.
=TRANSPOSE(MMULT(
(COLUMN(MyRange) <= TRANSPOSE(COLUMN(MyRange)))*MyRange,
TRANSPOSE(SIGN(MyRange))
))- Detlef_LewinApr 30, 2021Silver Contributor
- SergeiBaklanApr 30, 2021Diamond Contributor
LET() shall be in production, perhaps except deferred semi-annual channel, not sure. MMULT() works fine, but that's not exactly the spill.
- keenadviceNov 23, 2021Brass Contributor
I know this has been answered now
But random googling on my part threw up this post
This one definitely works (and is simpler than some others here)โ