K
Karl
I'm working on an Excel model and the algebra has me stuck as much as the
programming.
Given the following values
Rate1= 0.833333%
A= 999,999.97
CashFlow1= 10,000.00
CashFlow2= 20,000.00
CashFlow3= 162,860.92
Num1= 2 (i.e. CashFlow1 repeats twice)
Num2= 4
Num3= 6
And this equation:
A=((((CashFlow3*((1-(1+Rate)^-Num3)/Rate))*(1+Rate)^-Num2)+(CashFlow2*(1-(1+Rate)^-Num2))/Rate)*(1+Rate)^-Num1)+(CashFlow1*(1-(1+Rate)^-Num1)/Rate)
I'm trying to rearrange it to solve for "Num2".
Can someone assist me?
These points/observations may be helpful:
Above pattern will repeat from 1.N times
That is, it is nested. The inner most nesting is this:
(CashFlow3*((1-(1+Rate)^-Num3)/Rate))
The next level of nesting takes that result from the above and uses it
in this (2nd level of nesting):
(((CashFlow3*((1-(1+Rate)^-Num3)/Rate))*(1+Rate)^-Num2)+(CashFlow2*(1-(1+Rate)^-Num2))/Rate)
I know that if there were only one CashFlow and one Num to solve for that
the equation would be:
Num = - (ln(1-(A*Rate)/CashFlow) / ln( 1+Rate))
I guess this is going to take a VBA loop. I'm comfortable enough with the
VBA. I don't understand what the algebra is though.
TIA.
programming.
Given the following values
Rate1= 0.833333%
A= 999,999.97
CashFlow1= 10,000.00
CashFlow2= 20,000.00
CashFlow3= 162,860.92
Num1= 2 (i.e. CashFlow1 repeats twice)
Num2= 4
Num3= 6
And this equation:
A=((((CashFlow3*((1-(1+Rate)^-Num3)/Rate))*(1+Rate)^-Num2)+(CashFlow2*(1-(1+Rate)^-Num2))/Rate)*(1+Rate)^-Num1)+(CashFlow1*(1-(1+Rate)^-Num1)/Rate)
I'm trying to rearrange it to solve for "Num2".
Can someone assist me?
These points/observations may be helpful:
Above pattern will repeat from 1.N times
That is, it is nested. The inner most nesting is this:
(CashFlow3*((1-(1+Rate)^-Num3)/Rate))
The next level of nesting takes that result from the above and uses it
in this (2nd level of nesting):
(((CashFlow3*((1-(1+Rate)^-Num3)/Rate))*(1+Rate)^-Num2)+(CashFlow2*(1-(1+Rate)^-Num2))/Rate)
I know that if there were only one CashFlow and one Num to solve for that
the equation would be:
Num = - (ln(1-(A*Rate)/CashFlow) / ln( 1+Rate))
I guess this is going to take a VBA loop. I'm comfortable enough with the
VBA. I don't understand what the algebra is though.
TIA.