curatedapi

Excel IPMT function: interest part of a payment

The interest paid in one period of a loan, the same as Excel's IPMT.

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.
The period you want, from 1 to nper. A ratio of two decimals such as "0.08/12" is accepted.
Total number of payment periods. A ratio of two decimals such as "0.08/12" is accepted.
Present value: the amount now (a loan you receive is positive). A ratio of two decimals such as "0.08/12" is accepted.
Future value wanted after the last payment. A ratio of two decimals such as "0.08/12" is accepted.
When payments are due: 0 at the end of each period, 1 at the beginning.
More options: rounding and decimals
Precision and rounding
Rounding mode applied once to each result. Default half_even.
Round results to this many digits after the decimal point.
Round results to this many significant digits.

Examples

Example: Microsoft's example: first month of a 3-year $8,000 loan at 10%

Ipmt
The interest in that period.
-66.67 rounded

Rounding: Half even, 2 decimal places. Calculator excel/ipmt@1.

How it is calculated

IPMT = rate · FV(rate, per − 1, PMT, pv, 0)  (type 0)

IPMT(rate, per, nper, pv, [fv], [type]): the interest in payment number per: the rate times the balance after the previous payment. With type 1 the first payment has no interest, as in Excel.

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

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.

Use it from your code

POST /v1/calc/excel/ipmtVersion 1
curl https://api.curatedapi.com/v1/calc/excel/ipmt \
  -H "Authorization: Bearer $CURATEDAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "rate": "0.10/12",
    "per": "1",
    "nper": "36",
    "pv": "8000",
    "options": {"decimals": 2}
  }'
The same call in Python
import os

import requests

payload = {
    "rate": "0.10/12",
    "per": "1",
    "nper": "36",
    "pv": "8000",
    "options": {
        "decimals": 2,
    },
}
response = requests.post(
    "https://api.curatedapi.com/v1/calc/excel/ipmt",
    headers={"Authorization": f"Bearer {os.environ['CURATEDAPI_KEY']}"},
    json=payload,
    timeout=10,
)
print(response.json()["result"])
The same call in JavaScript
const payload = {
    "rate": "0.10/12",
    "per": "1",
    "nper": "36",
    "pv": "8000",
    "options": {
        "decimals": 2,
    },
};
const response = await fetch("https://api.curatedapi.com/v1/calc/excel/ipmt", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.CURATEDAPI_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify(payload),
});
console.log((await response.json()).result);

MCP tool calc_excel_ipmt at https://mcp.curatedapi.com. Inputs, outputs and errors in the API reference.

Put it on your website

<div data-curatedapi-widget="excel/ipmt" data-key="capi_public_…"></div>
<script src="https://widgets.curatedapi.com/v1/widget.js" async></script>

Use a public key registered for your site. Calculations are billed like API calls. How widgets work.

Related calculators

Get Excel's answer in your own code

Moving a spreadsheet model into an app? The API returns what Excel returns for the same inputs, so your users see the same numbers in both.

Free for up to 1,000 calculations a month. 50,000 calculations a month cost $9.00 on the Starter plan.