Mar 02 2021 11:11 AM
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
Mar 02 2021 06:23 PM - edited Mar 02 2021 06:35 PM
SolutionYour 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.
Mar 02 2021 06:23 PM - edited Mar 02 2021 06:35 PM
SolutionYour 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.