curatedapi
Browse the docs

Guides

Finance

Excel functions

Late payments

E-invoices

Accounting

Number checks

VAT and GST

Billing and pricing

Money and currencies

Dates and time

Math

Unit conversion

Everyday

Health

Excel IPMT function: interest part of a payment API

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

POST https://api.curatedapi.com/v1/calc/excel/ipmt

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.

Formula

IPMT = rate · FV(rate, per − 1, PMT, pv, 0)  (type 0)
  • 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).

InputTypeDescription
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.
per required decimal (string) The period you want, from 1 to nper. A ratio of two decimals such as "0.08/12" is accepted. Allowed: >= 1 and <= 12000.
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.
pv required decimal (string) Present value: the amount now (a loan you receive is positive). 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.

ResultTypeDescription
ipmtdecimal (string)The interest in that period.

Examples

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

Requestcurl
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}
  }'
200 OKResponse
{
  "calculator": "excel/ipmt@1",
  "result": {
    "ipmt": "-66.67"
  },
  "exactness": {
    "ipmt": "rounded"
  },
  "precision": {
    "rounding": "half_even",
    "decimals": 2
  },
  "inputs": {
    "rate": "1/120",
    "per": "1",
    "nper": "36",
    "pv": "8000",
    "fv": "0",
    "type": 0
  },
  "formula": "IPMT = rate · FV(rate, per − 1, PMT, pv, 0)  (type 0)",
  "references": [
    {
      "title": "Microsoft Excel IPMT function",
      "url": "https://support.microsoft.com/en-us/excel/functions/ipmt-function"
    }
  ],
  "warnings": []
}

Microsoft's example: last year of the same loan with yearly payments

Requestcurl
curl https://api.curatedapi.com/v1/calc/excel/ipmt \
  -H "Authorization: Bearer $CURATEDAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "rate": "0.10",
    "per": "3",
    "nper": "3",
    "pv": "8000",
    "options": {"decimals": 2}
  }'
200 OKResponse
{
  "calculator": "excel/ipmt@1",
  "result": {
    "ipmt": "-292.45"
  },
  "exactness": {
    "ipmt": "rounded"
  },
  "precision": {
    "rounding": "half_even",
    "decimals": 2
  },
  "inputs": {
    "rate": "0.1",
    "per": "3",
    "nper": "3",
    "pv": "8000",
    "fv": "0",
    "type": 0
  },
  "formula": "IPMT = rate · FV(rate, per − 1, PMT, pv, 0)  (type 0)",
  "references": [
    {
      "title": "Microsoft Excel IPMT function",
      "url": "https://support.microsoft.com/en-us/excel/functions/ipmt-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.