Excel CUMPRINC function: principal paid between two periods API
Total principal repaid from one period to another, as Excel's CUMPRINC.
POST https://api.curatedapi.com/v1/calc/excel/cumprinc
- Version 1
- MCP tool
calc_excel_cumprinc - Try it in the browser
CUMPRINC(rate, nper, pv, start_period, end_period, type).
Formula
Σ PPMT(rate, k, nper, pv, 0, type) for k = start_period … end_period
- 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: > 0 and <= 1000. |
nper required |
integer | Total number of payment periods. Allowed: >= 1 and <= 12000. |
pv required |
decimal (string) | Present value (the loan amount). A ratio of two decimals such as "0.08/12" is accepted. Allowed: > 0 and <= 1000000000000000. |
start_period required |
integer | First period to include (periods start at 1). Allowed: >= 1 and <= 12000. |
end_period required |
integer | Last period to include. Allowed: >= 1 and <= 12000. |
type required |
integer | 0: payments 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 |
|---|---|---|
cumprinc | decimal (string) | Total principal over the periods (negative: paid). |
Examples
Microsoft's example: principal in the second year of a 30-year $125,000 loan
curl https://api.curatedapi.com/v1/calc/excel/cumprinc \
-H "Authorization: Bearer $CURATEDAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"rate": "0.09/12",
"nper": 360,
"pv": "125000",
"start_period": 13,
"end_period": 24,
"type": 0,
"options": {"decimals": 7}
}'
{
"calculator": "excel/cumprinc@1",
"result": {
"cumprinc": "-934.1071234"
},
"exactness": {
"cumprinc": "rounded"
},
"precision": {
"rounding": "half_even",
"decimals": 7
},
"inputs": {
"rate": "0.0075",
"nper": 360,
"pv": "125000",
"start_period": 13,
"end_period": 24,
"type": 0
},
"formula": "Σ PPMT(rate, k, nper, pv, 0, type) for k = start_period … end_period",
"references": [
{
"title": "Microsoft Excel CUMPRINC function",
"url": "https://support.microsoft.com/en-us/excel/functions/cumprinc-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.