Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
This Excel lambda function demonstrates a use of recursion in a financial context to calculate effective interest
Calculates the effective interest rate using a simplified assumption.
The intent here is to show an example of recursion in a financial function.
- opening_balance – the opening balance of some period of interest
- base_rate – the base rate of the instrument
- [interest] – OPTIONAL – this is used by the recursion to pass the calculated interest back into the formula to calculate the closing balance (and therefore average balance) during each iteration. Generally speaking, this should not be used when using this function to call from the downs
Please watch this video:
Explanatory post:
INTRATE.EFFECTIVE = LAMBDA(opening_balance, base_rate, [interest],
_int, IF(ISOMITTED(interest), 0, interest),
_new_close, opening_balance + _int,
_avg_balance, AVERAGE(opening_balance, _new_close),
_new_int, _avg_balance * base_rate,
_effective_rate, IF(
ROUND(_new_int, 2) = ROUND(_int, 2),
_new_int / opening_balance,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment