Forum Discussion
PeterBartholomew1
Sep 27, 2020Silver Contributor
Would a FOR.EACH function be useful in Excel 365?
The attached files are based upon a workbook that emulates the proposed function using a VBA macro. There would appear to be many potential applications in situations where the @operator needs to be...
PeterBartholomew1
Dec 07, 2020Silver Contributor
I think the attached workbook demonstrates that it should be possible to use recursion to perform accumulation. In the absence of the LAMBDA function, I have used rows on the worksheet to emulate a recursion stack.
As things stand, it would appear to require N² memory locations but that might depend upon the details of memory management as results are passed back from the stack.
Do you have any thoughts on the matter?
SergeiBaklan
Dec 08, 2020Diamond Contributor
I tried to play with, result is in the row below
and function
=LAMBDA(s,n,
if(n<=argument,
acc(
LET(
sm, SUM(INDEX(inflow,1,1):INDEX(inflow,1,n)),
k, SEQUENCE(,n),
IF( k<n, s, sm )
),
n+1
),
s+BFwd
)
)