I am getting really confused on how to calculate the rate of return as well as calculating the future value in a particular year.
p=[]
a=[]
c=[]
for a in range(2,sh1.nrows):
p.append(int(sh1.cell(a,0).value))
a.append(float(sh1.cell(a,1).value))
c.append(str(sh1.cell(a,2).value))
print(p)
print(a)
print(c)
i=0
for b in p:
b+1;
pv = a[0] = a[b] / ((1 + i)**p[b], p[b])
print(pv)
Okay. So, as you can in the two images that there are time values and amounts given. Now, if you are familiar with internal rate of return, present value, future value, and all that stuff then what I am about to explain will be more clear to you.
What I am trying to achieve by using the code is to calculate the IRR and also the future value in time 9. In addition, the pay period is in months and the compound period is in years, and this could different in another question, so I have keep it flexible. When I get both of those I need a visual that shows how much percent of the future value of each category(column 3) will be at time 9. The visual should also show the total future value and the IRR at time 9.
Also, the data is being pulled from excel. I would upload the excel file here, but I don't think I can.
The answer is: 2.08% and the inflows-outflows is $2.40
Aucun commentaire:
Enregistrer un commentaire