SOLVED

Calculate a Sum with Lambda

Copper Contributor

I defined a recursive lambda call "Sum_L" to calculate the Sum of nth parcels but received #value

=LAMBDA(tcp,tt,n,IF(n<1,0,Sum_L(n-1)+((1+tcp)/(1+tt))^n))

Can u help to resolve this?

 

Thanks in advance

Pedro

 

2 Replies
@Chris_Gross can you help?
best response confirmed by cuong (Microsoft)
Solution

Your lambda requires three parameters (tcp, tt, n), so your reference to itself should have 3 parameters as well. If tcp, tt don't change, it would be this: LAMBDA(tcp,tt,n,IF(n<1,0,Sum_L(tcp,tt,n-1)+((1+tcp)/(1+tt))^n))

 

Please see attached.

1 best response

Accepted Solutions
best response confirmed by cuong (Microsoft)
Solution

Your lambda requires three parameters (tcp, tt, n), so your reference to itself should have 3 parameters as well. If tcp, tt don't change, it would be this: LAMBDA(tcp,tt,n,IF(n<1,0,Sum_L(tcp,tt,n-1)+((1+tcp)/(1+tt))^n))

 

Please see attached.

View solution in original post