In: Finance
Inputs: Use 2 inputs: cash flow vector, interest rate. Use values: cash flow = (-10, 2, 4, 5, 9, 6), interest rate = 12%. Assume that cash flows start at t=0 and go on year by year.
Output: Produce a table containing years, cash flows, PV of cash flows, and a summary with NPV, PI, and Payback.
(Rstudio)
Year | Cash flows | PV of CF | Cumulative CF |
0 | -10 | -10 | -10 |
1 | 2 | 1.785714 | -8 |
2 | 4 | 3.188776 | -4 |
3 | 5 | 3.558901 | 1 |
4 | 9 | 5.719663 | 10 |
5 | 6 | 3.404561 | 16 |
NPV | 7.66 |
PI | 1.77 |
Payback | 2.80 |
WORKINGS