Hi Karl. I think the problem is a little hard to do in one shot. I
couldn't really follow your equation.
Most of the other cash flow info can be factored out. I would then just
work on your CashFlow #2 problem separately.
This would make it more flexible and easier to use.
Lets just work with #2.
We know the npv of cash flows (k) over so many months z is...
npv = Sum[k/(1 + r)^m, {m, 1, z}]
(k - k/(1 + r)^z)/r
But we really want to back this up 'm months to our time period zero.
If given a starting value s, and the Cf's start in m months, we really want
to solve for z.
z is Num2 in your question:
Errr..I'm going to have to cheat here. It's late...
Solve[s*(1 + r)^m == npv, z]
z -> -(Log[1 - (r*(1 + r)^m*s)/k]/Log[1 + r])
Now that we have that, here's a macro that will hopefully solve your
equation and return 4 months.
Sub Demo()
Dim r, k, t, z, s
Dim Answer As Single
r = 0.1 / 12
'Group 3
k = 162860.92
z = 6
t = (k - k / (1 + r) ^ z) / r
'Back it up 6 months to time 0
s = t / (1 + r) ^ 6
'Group 1
k = 10000
z = 2
t = (k - k / (1 + r) ^ z) / r
'It's at time 0 already
s = s + t
'Now Group 2
'Find remaining balance
s = 999999.97 - s
k = 20000
t = 2 'It starts in 2 months.
Answer = -(Log(1 - (r * (1 + r) ^ t * s) / k) / Log(1 + r))
End Sub
The answer I get is indeed 4.0 :>)
HTH. :>)
--
Dana DeLouis
"Karl Thompson(PGS)" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> No, it's not the rate. That's solved by iteration. We have the rate. It's
> 10% per annum..
>
> "John" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> At first glance this looks like an internal rate of return problem which
>> can get pretty dicey. Try "internal rate of return" in google. I forgot a
>> long time ago.
>>
>> John
>>
>> Karl wrote:
>>
>>> 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.
>>>
>>>
>>>
>>>
>>>
>>>
>
|