1

I have excel in which there is a row with 11 values in it.

TotalSavings = [0, 8000, 8000, 8000, 8000, 8000, 8000, 8000, 8000, 8000, 8000]

with the discount rate of 0.08, I calculated the NPV in excel using =NPV(0.08, TotalSavings) (obviously there were 11 columns so instead of TotalSavings there is C3:C14(here C3 is 0 value and C14 is 8000)). Its was 49704. And when I did the same thing with numpy NPV.

print(np.npv(0.08, TotalSavings))

Result was: 53680. Can someone please help? I want the same result as we are getting in excel.

Vesper
  • 795
  • 1
  • 9
  • 21

1 Answers1

5

Seems one uses beginning of period payments and the other uses end of period payments.

numpy's formula is

(values / (1+rate)**np.arange(0, len(values))).sum(axis=0)

Changing it to

(values / (1+rate)**np.arange(1, len(values)+1)).sum(axis=0)

produces the same value you get with excel.



For excel this makes the denominator larger for each term in the summation resulting in a smaller sum.

wwii
  • 23,232
  • 7
  • 37
  • 77