Hi,
I need to write a UDC for Discounted Payback method. I wrote the code for the payback part of the problem but cannot do the discounted cashflows section. I need to write one code and cannot calculate the discounted CFs in Excel beforehand. Please see problem and info copied below.
Help please!
Function Payback(NumFutureCFs, Cost, RangeFutureCFs)
Dim loopcounter As Integer
Dim AccumulationCF As Single
AccumulationCF = Cost
For loopcounter = 1 To NumFutureCFs
AccumulationCF = AccumulationCF + RangeFutureCFs(loopcounter)
If AccumulationCF >= 0 Then Exit For
Next loopcounter
Payback = loopcounter - 1 + -(AccumulationCF - RangeFutureCFs(loopcounter)) / RangeFutureCFs(loopcounter)
Use your user defined function to solve for the discounted payback period on the following project. You want
to be select the raw cash flows. The function should discount them and determine the discounted
payback period.
Year cash flow
year 0 (10000)
Year 1 2000
Year 2 3000
Year 3 3500
Year 4 4000
Year 5 4000
Discount Rate 9%
End Function
Bookmarks