Pergunta

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.

Foi útil?

Solução

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).

Outras dicas

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top