문제

The PV function of Excel (present value of an investment) seems to make a sudden jump somewhere and is raising an error. For example:

WorksheetFunction.PV(-19, 240, 500000)

will return a value while:

WorksheetFunction.PV(-20, 240, 500000)

will raise an exception. There are other examples where things go wrong. Independently of the semantic meaning of the parameters, the formula to calculate the PV is purely continuous around the jump, so what is causing this?

When calculating things in, for instance, Mathematica this does not happen.

도움이 되었습니까?

해결책

The first term of the formula used to calculate PV is PV * (1+rate) ^ nper (as in your link). Using your first example this gives 4.84861419016704E+304 so close enough to Excel’s limit (of 9.99999999999999E+307) that no element of the first term would have to increase by much for the result to exceed the inbuilt limitation, for which your second example seems to have been enough.

Note that, as @Juliusz has pointed out, the first parameter is the interest rate per period and 19 represents 1900%. For 240 periods (looks like 20 years) the combination is not realistic (ie 1900% per month). Also, the rate should not normally be negative (better to handle whether in or out by signing the payment amount).

다른 팁

Seems that -19.45 is the minimum value, which translates to -1945%. Are you sure you need more?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top