Excel PV function: present value API
The present value of a series of equal payments, the same as Excel's PV.
POST https://api.curatedapi.com/v1/calc/excel/pv
- Version 1
- MCP tool
calc_excel_pv - Try it in the browser
PV(rate, nper, pmt, [fv], [type]): what the payments (and fv) are worth now.
Formula
PV = −(fv + pmt·(1 + rate·type)·((1+rate)^nper − 1)/rate) / (1+rate)^nper
- Arguments are named and ordered as in Excel. Excel computes in binary floating point; this API computes the exact value of the same formula and rounds it once, so it agrees with Excel to the digits Excel can show, and where Excel's own rounding error reaches the 15th digit this answer is the correct one.
Inputs
Send numbers as strings to keep every digit. options sets precision and rounding (see numbers and rounding).
| Input | Type | Description |
|---|---|---|
rate required |
decimal (string) | Interest rate per period, as a decimal (0.005 for 0.5%). Write a monthly rate from an annual one as "0.06/12". A ratio of two decimals such as "0.08/12" is accepted. Allowed: > -1 and <= 1000. |
nper required |
decimal (string) | Total number of payment periods. A ratio of two decimals such as "0.08/12" is accepted. Allowed: > 0 and <= 12000. |
pmt required |
decimal (string) | Payment made each period (negative when you pay). A ratio of two decimals such as "0.08/12" is accepted. Allowed: >= -1000000000000000 and <= 1000000000000000. |
fv |
decimal (string) default 0 |
Future value wanted after the last payment. A ratio of two decimals such as "0.08/12" is accepted. Allowed: >= -1000000000000000 and <= 1000000000000000. |
type |
integer default 0 |
When payments are due: 0 at the end of each period, 1 at the beginning. Allowed: >= 0 and <= 1. |
options.rounding |
half_even | half_up | half_down | up | down | ceiling | floor | Rounding mode applied once to each result. Default half_even. |
options.decimals |
integer | Round results to this many digits after the decimal point. |
options.significant_digits |
integer | Round results to this many significant digits. |
Result
Under result in the answer, next to exactness, precision, inputs, formula, references and warnings.
| Result | Type | Description |
|---|---|---|
pv | decimal (string) | The present value. |
Examples
Microsoft's example: $500 a month for 20 years at 8%
curl https://api.curatedapi.com/v1/calc/excel/pv \
-H "Authorization: Bearer $CURATEDAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"rate": "0.08/12",
"nper": "240",
"pmt": "500",
"options": {"decimals": 2}
}'
{
"calculator": "excel/pv@1",
"result": {
"pv": "-59777.15"
},
"exactness": {
"pv": "rounded"
},
"precision": {
"rounding": "half_even",
"decimals": 2
},
"inputs": {
"rate": "1/150",
"nper": "240",
"pmt": "500",
"fv": "0",
"type": 0
},
"formula": "PV = −(fv + pmt·(1 + rate·type)·((1+rate)^nper − 1)/rate) / (1+rate)^nper",
"references": [
{
"title": "Microsoft Excel PV function",
"url": "https://support.microsoft.com/en-us/excel/functions/pv-function"
}
],
"warnings": []
}
References
Results follow each calculator's documented rules and the sources listed. They are not financial, tax or legal advice. Check that the rules fit your case before you rely on a result. See the terms.
Errors share one format; see errors. Billing, retries and batches work the same for every endpoint.