Forum Discussion
Stack sequences of various size
Hi
With Office 365/Windows, how do I generate the Expected dynamic array from the Inputs range?
No Power Query nor VBA please, LAMBDA is fine though
Thanks
Lorenzo I bet one of those new text manipulation functions may help do this but I don't have beta channel so here is my solution:
=LET(in,Inputs,inc,SCAN(0,in,LAMBDA(c,I,I+c)),s,SEQUENCE(SUM(in)),s-XLOOKUP(s,inc+1,inc,0,-1))
10 Replies
- Patrick2788Silver Contributor
- LorenzoSilver Contributor
- PeterBartholomew1Silver Contributor
With the full set of text manipulation functions
= REDUCE(hdr,Inputs,StackedIndicesλ) where StackedIndicesλ = LAMBDA(u,n,VSTACK(u,SEQUENCE(n)))
- LorenzoSilver Contributor
First of all THANK YOU. I wasn't far from mtarler option but I missed something
I can't implement Peter's option as VSTACK isn't avail. here yet but as this site doen't allow marking more than 1 solution I want to mark the most efficient one
Peter,
1) On a significantly larger Inputs range is it fair to assume that your option will be faster?
2) How do you generate the same output without the hdr row?
Thanks again
- PeterBartholomew1Silver Contributor
I don't think calculation time is going to come into it. I tried 280 numbers totalling almost 30,000 rows.
My formula returned 240.5ms±8.8 and Matt's 238.8ms±14.5 (the ± being 1 standard deviation)