Excel MIRR function: modified internal rate of return API
The modified IRR of periodic cash flows with separate finance and reinvestment rates, as Excel's MIRR.
POST https://api.curatedapi.com/v1/calc/excel/mirr
- Version 1
- MCP tool
calc_excel_mirr - Try it in the browser
MIRR(values, finance_rate, reinvest_rate): negative flows are discounted at finance_rate, positive flows compounded at reinvest_rate, and the rate linking the two over n − 1 periods is returned.
Formula
MIRR = (−NPV(rrate, positive)·(1+rrate)ⁿ / (NPV(frate, negative)·(1+frate)))^(1/(n−1)) − 1
- 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 |
|---|---|---|
values required |
list of decimal (string) | Periodic cash flows, the first at the start. 2 to 1000 items. Each item: >= -1000000000000000 and <= 1000000000000000. |
finance_rate required |
decimal (string) | Rate paid on money borrowed (negative flows). A ratio of two decimals such as "0.08/12" is accepted. Allowed: > -1 and <= 100. |
reinvest_rate required |
decimal (string) | Rate earned on money reinvested (positive flows). A ratio of two decimals such as "0.08/12" is accepted. Allowed: > -1 and <= 100. |
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 |
|---|---|---|
mirr | decimal (string) | Modified IRR per period, as a decimal. |
Examples
Microsoft's example: five years
curl https://api.curatedapi.com/v1/calc/excel/mirr \
-H "Authorization: Bearer $CURATEDAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"values": ["-120000", "39000", "30000", "21000", "37000", "46000"],
"finance_rate": "0.1",
"reinvest_rate": "0.12",
"options": {"decimals": 2}
}'
{
"calculator": "excel/mirr@1",
"result": {
"mirr": "0.13"
},
"exactness": {
"mirr": "rounded"
},
"precision": {
"rounding": "half_even",
"decimals": 2
},
"inputs": {
"values": [
"-120000",
"39000",
"30000",
"21000",
"37000",
"46000"
],
"finance_rate": "0.1",
"reinvest_rate": "0.12"
},
"formula": "MIRR = (−NPV(rrate, positive)·(1+rrate)ⁿ / (NPV(frate, negative)·(1+frate)))^(1/(n−1)) − 1",
"references": [
{
"title": "Microsoft Excel MIRR function",
"url": "https://support.microsoft.com/en-us/excel/functions/mirr-function"
}
],
"warnings": []
}
Microsoft's example: three years
curl https://api.curatedapi.com/v1/calc/excel/mirr \
-H "Authorization: Bearer $CURATEDAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"values": ["-120000", "39000", "30000", "21000"],
"finance_rate": "0.1",
"reinvest_rate": "0.12",
"options": {"decimals": 2}
}'
{
"calculator": "excel/mirr@1",
"result": {
"mirr": "-0.05"
},
"exactness": {
"mirr": "rounded"
},
"precision": {
"rounding": "half_even",
"decimals": 2
},
"inputs": {
"values": [
"-120000",
"39000",
"30000",
"21000"
],
"finance_rate": "0.1",
"reinvest_rate": "0.12"
},
"formula": "MIRR = (−NPV(rrate, positive)·(1+rrate)ⁿ / (NPV(frate, negative)·(1+frate)))^(1/(n−1)) − 1",
"references": [
{
"title": "Microsoft Excel MIRR function",
"url": "https://support.microsoft.com/en-us/excel/functions/mirr-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.