{
  "category": "Math and trigonometry functions",
  "display_name": "MINVERSE",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.MINVERSE",
  "implementation_state": {
    "answer_bank": {
      "excel_builds": [
        "20131",
        "20228"
      ],
      "larger_numeric": 0,
      "last_bit": 0,
      "matched": 1683,
      "other_mismatch": 0,
      "refused": 0,
      "rows": 1795,
      "unread": 112,
      "worst_ulp": 0
    },
    "detail": "Recorded: 1,683 in the answer bank and 68 workbook cells.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "matches",
    "state_label": "Matches every recorded Excel answer",
    "summary": "Matches all 1,751 recorded answers",
    "workbook_corpus": {
      "cells": 68,
      "matched": 68
    }
  },
  "implementations": [
    {
      "commit": "9e1884369a678158dd82d3d74188daf986995e87",
      "flavour": "excel-compatibility-candidate",
      "language": "Rust",
      "name": "CalcFunc",
      "own_code": [
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/math.rs#L222-L226",
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/ported/matrix_family.rs#L59-L130"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/math::matrix",
        "ported/excel_numeric::binary_with",
        "ported/excel_numeric::excel_x87_sub",
        "ported/excel_numeric::excel_x87_mul",
        "ported/excel_numeric::excel_x87_div",
        "ported/excel_numeric/x87::mul",
        "ported/excel_numeric/x87::sub",
        "ported/excel_numeric/x87::div"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/math.rs#L222-L226",
      "state": "matches",
      "suite": null,
      "summary": "Matches all 1,751 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.MINVERSE.json",
  "name": "MINVERSE",
  "notes": [],
  "schema": "efh.function-reference/v1",
  "section_order": [
    "what-it-does",
    "try-it",
    "quirks",
    "how-to-implement",
    "version-differences",
    "alternatives"
  ],
  "sections": {
    "alternatives": "\n### Relationships\n\n\n- **[MMULT](FUNC.MMULT.md)** — the verifier. `MMULT(A, MINVERSE(A))` against\n  [MUNIT](FUNC.MUNIT.md) is the residual test, and it is the single most useful thing a reader can\n  do with these four functions together.\n- **[MDETERM](FUNC.MDETERM.md)** — shares the family's LU forward elimination in the reference\n  engine, and is related mathematically by det(A⁻¹) = 1/det A. **Sharing an elimination is not\n  sharing a measurement**: `MDETERM`'s own evidence record forbids it from borrowing this page's\n  figures, and this page does not lend them.\n- **[MUNIT](FUNC.MUNIT.md)** — the identity the inverse is defined against.\n- **`LINEST` / `TREND` / `LOGEST`** — regression surfaces that solve linear systems internally.\n  They are the reason most worksheets *think* they need `MINVERSE`, and they are usually the better\n  tool, because they solve rather than invert.\n- **`SUMPRODUCT` with an explicit 2×2 formula** — for the smallest cases, writing out\n  `1/(ad-bc)·[d,-b;-c,a]` is a legitimate alternative and is often more accurate than a general\n  factorisation, because it performs fewer operations.\n\n**The most important relationship is a negative one: do not invert to solve.** To compute A⁻¹b,\nsolve Ax = b. Forming the inverse and multiplying is slower, less accurate, and needs a\nnonsingular matrix where a solve needs only a consistent system. Higham devotes a section to this\n(*Accuracy and Stability of Numerical Algorithms*, chapter 14, on the \"fallacy\" of matrix\ninversion); Excel's worksheet surface unfortunately makes the wrong route the easy one, since\n`MINVERSE` exists and a general solve does not.\n\n\n",
    "how-to-implement": "\n### Numerical notes\n\n\n### The algorithm space, and what has been ruled out of it\n\n- **Adjugate / cofactor (Cramer's rule)** — ruled out at both sizes tested. Cramer's rule is the\n  textbook formula and is numerically the worst of the candidates; it is also O(n!) if implemented\n  literally.\n- **An x87 80-bit extended-precision body with double stores** — ruled out, and strictly worse than\n  plain binary64. Note the contrast with [LN](FUNC.LN.md) and [LOG](FUNC.LOG.md), where the x87\n  substrate is exactly what *was* identified. Different Excel surfaces sit on different substrates,\n  and that is a finding in itself.\n- **A systematic sweep of solve orderings** — forward against back substitution, streamed against\n  sum-then-subtract accumulation, ascending against descending index order, division against\n  reciprocal-multiply — all eliminated. This is the shape of the last-bit problem: the *op graph*,\n  not the algorithm name, is what determines the final bits.\n\n\n### Why the last bits are hard at all\n\n### Conditioning governs everything\n\nThe relative error in a computed inverse is bounded by roughly κ(A)·u, with κ the condition number\nand u the unit roundoff. For an ill-conditioned matrix the computed inverse can have **no correct\ndigits at all** while still satisfying a small backward error. Two consequences a reader should\ncarry away:\n\n1. **A small residual `MMULT(A, MINVERSE(A)) − I` does not certify the inverse.** Backward\n   stability gives you a small residual almost regardless of conditioning; it does not give you a\n   small forward error.\n2. **Near-singular is a continuum, not a boundary.** The `#NUM!` from `MINVERSE` fires at some\n   threshold; just inside it, the function returns numbers that are formally defined and\n   practically meaningless. The dangerous inputs are the ones that do *not* error.\n\nGolub and Van Loan, *Matrix Computations*, section 3.5, and Higham chapter 14, are the standard\ntreatments; the residual-versus-error distinction is Higham's chapter 7.\n\n\n",
    "quirks": "\n### Result and edge cases\n\n\nReturns `Array` of `Number`.\n\n- **A 1×1 zero matrix** produces `#NUM!` — singular, correctly.\n- **A 1×1 matrix holding −1** returns a 1×1 array holding −1, its own reciprocal.\n- **A logical argument** and **numeric text** both produce `#VALUE!`. As with\n  [MDETERM](FUNC.MDETERM.md), the matrix family refuses conversions that the scalar math functions\n  accept. The text refusal is documented; the logical refusal is not.\n- **The largest finite double** as a 1×1 matrix returns its reciprocal, a subnormal-range value.\n- **The smallest positive subnormal** as a 1×1 matrix produces **`#NUM!`** — not a reciprocal.\n  Mathematically the matrix is nonsingular; its inverse simply is not representable, since the\n  reciprocal overflows. The engine reports it as the singular case. **The documented criterion is\n  \"the determinant is 0\", and this matrix's determinant is not zero**, so the observable behaviour\n  and the documented rule part company here. Whatever the right design is, the honest statement is\n  that `#NUM!` from `MINVERSE` covers at least two distinct conditions — genuinely singular, and\n  representably impossible — and only one of them is documented.\n- **An inline 2×2 integer array** returns an inverse whose entries **are not the exactly\n  representable values the true inverse has**. The exact inverse of that particular matrix has\n  entries every one of which is a binary64 value; the returned entries differ from them in the last\n  bits. This is not a defect report against anyone — it is the expected signature of a\n  factorisation-based solve, and it is exactly why this function has a live numeric investigation\n  attached. See \"Numerical notes\".\n\n\n\n### Errors\n\n\n| Error | Documented condition |\n|---|---|\n| `#VALUE!` | \"If any cells in array are empty or contain text, MINVERSE returns a #VALUE! error\" |\n| `#VALUE!` | \"MINVERSE also returns a #VALUE! error if array does not have an equal number of rows and columns\" |\n| `#NUM!` | The matrix cannot be inverted; \"The determinant for a noninvertable matrix is 0\" |\n\nError values inside the array propagate; the family declares a reduction error-collapse profile,\nso competing errors are folded rather than surfacing independently\n([coercion and lifting](../model/02-coercion-and-lifting.md)).\n\n**On the documented `#NUM!` criterion.** \"The determinant is 0\" is the mathematical criterion and\nis not a computational test — see the singularity discussion on\n[MDETERM](FUNC.MDETERM.md). No implementation can determine exact singularity from rounded inputs;\nwhat it can do is detect a pivot that has become negligible relative to the matrix's scale. So the\ndocumented rule describes the *intent*, and the observed threshold behaviour is a different, and\nundocumented, thing. The subnormal case above shows the gap is real.\n\n**On the accuracy remark.** Microsoft's page states:\n\n> \"MINVERSE is calculated with an accuracy of approximately 16 digits, which may lead to a small\n> numeric error when the cancellation is not complete.\"\n\nAs on [MDETERM](FUNC.MDETERM.md), this is not an error bound: \"approximately 16 digits\" describes\nbinary64 generally, and \"when the cancellation is not complete\" names no determinable condition.\nThe real bound is conditioning-dependent and is stated below.\n\n\n",
    "sources": "- Microsoft, \"MINVERSE function\" —\n  <https://support.microsoft.com/en-us/office/minverse-function-11f55086-adde-4c9f-8eb9-59da2d72efc6>.\n  Retrieved for this page: the syntax, the array argument description and its permitted forms, the\n  two `#VALUE!` conditions, the `#NUM!` singular condition with its determinant criterion, the\n  accuracy remark quoted above, and the dynamic-array versus legacy-array entry mechanics.\n- Handbook evidence record `EV-STRUCT-0012` — provisional structural COM probe over the matrix\n  family; pinned values, no count, no named build.\n- N. J. Higham, *Accuracy and Stability of Numerical Algorithms*, 2nd edition, chapters 7 and 14 —\n  residual versus forward error, LU error analysis, and the case against forming inverses.\n- G. H. Golub and C. F. Van Loan, *Matrix Computations*, 4th edition, sections 3.2 and 3.5 —\n  pivoting, conditioning, and solving in preference to inverting.\n- Handbook, [MDETERM](FUNC.MDETERM.md), [MMULT](FUNC.MMULT.md), [MUNIT](FUNC.MUNIT.md) — the rest\n  of the family; [coercion and lifting](../model/02-coercion-and-lifting.md) — error propagation\n  and the reduction fold.\n\n\n",
    "version-differences": "The recorded environments below distinguish a reading from a same-input comparison. Counts describe captured inputs in each environment; overlapping captures and comparisons are not totals of unique worksheet calls.\n\n| Excel 16.0 build | Platform and CPU | Captured inputs |\n|---|---|---:|\n| 20131 | Windows, bitness not recorded, AMD Ryzen 7 4800H with Radeon Graphics | 49 |\n| 20228 | Windows, 64-bit, CPU not recorded | 985 |\n\nThe record contains no same-input comparison between these environments. Reading different inputs on different builds does not establish either a version change or cross-build agreement.\n\n[Recorded environments and comparison details](https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/5dc75391aa5125ccc5abdb095da85950980d6fd8/content/evidence/environments/FUNC.MINVERSE.json).",
    "what-it-does": "\n`MINVERSE(array)` returns the **matrix inverse** of a square matrix: the unique matrix A⁻¹ with\n\n    A · A⁻¹ = A⁻¹ · A = I\n\n**Existence.** A⁻¹ exists exactly when *A* is nonsingular, equivalently when det A ≠ 0,\nequivalently when the columns are linearly independent, equivalently when the only solution of\nAx = 0 is x = 0. Microsoft's page states the criterion in the determinant form: \"Some square\nmatrices cannot be inverted and will return the #NUM! error value with MINVERSE. The determinant\nfor a noninvertable matrix is 0.\"\n\n**The closed form** — and the reason it must not be used as an algorithm — is Cramer's rule:\n\n    A⁻¹ = adj(A) / det(A)\n\nwhere adj(A) is the transpose of the cofactor matrix. For a 2×2 matrix this is the familiar\n\n    [a b; c d]⁻¹ = 1/(ad − bc) · [d −b; −c a]\n\n**Properties** worth carrying: (AB)⁻¹ = B⁻¹A⁻¹ (note the order reversal); (Aᵀ)⁻¹ = (A⁻¹)ᵀ;\ndet(A⁻¹) = 1/det(A); and the inverse of a diagonal matrix is the elementwise reciprocal. The map\nA ↦ A⁻¹ is smooth on the open set of nonsingular matrices, with derivative −A⁻¹ (dA) A⁻¹ — which\nis the analytic statement of the fact that inversion is badly behaved near singularity: the\nderivative blows up as A⁻¹ does.\n\n**Domain and range.** Domain: nonsingular square numeric matrices. Range: nonsingular square\nmatrices. There is no pole in the analytic sense, but the set of singular matrices is a\nmeasure-zero hypersurface (the zero set of the determinant polynomial) across which the function\nis unbounded — the closest thing to a singularity a matrix function has, and the origin of every\ndifficulty below.\n\n\n\n### Arguments\n\n\n| Argument | Meaning | Required |\n|---|---|---|\n| `array` | \"A numeric array with an equal number of rows and columns.\" | Yes |\n\nExactly one argument; the declared arity is one to one. Microsoft's page notes the array may be\ngiven as a cell range such as `A1:C3`, an array constant such as `{1,2,3;4,5,6;7,8,9}`, or a name.\n\n**Result shape.** `MINVERSE` returns an array the same size as its input. Microsoft's page states\nthe entry mechanics explicitly: in current Microsoft 365 the formula is entered in the top-left\ncell and confirmed with Enter, spilling; in earlier versions the output range must be selected\nfirst and the formula confirmed with Ctrl+Shift+Enter as a legacy array formula. That difference\nis a property of the host, not of the function.\n\n\n"
  },
  "signature": {
    "display": "MINVERSE(array)",
    "parameters": [
      {
        "description": null,
        "name": "array",
        "optional": false,
        "repeats": false
      }
    ],
    "trailing_repeats": false
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "implemented",
        "reason": null
      },
      "arity": {
        "max": 1,
        "min": 1
      },
      "category": "Math and trigonometry functions",
      "classification": {
        "arg_preparation_profile": "RefsVisibleInAdapter",
        "coercion_lift_profile": "Custom",
        "determinism_class": "Deterministic",
        "error_collapse_profile": "ReductionFold",
        "fec_dependency_profile": "RefOnly",
        "host_interaction_class": "None",
        "kernel_signature_class": "Custom",
        "rich_value_usage": "RichBlind",
        "surface_fec_dependency_profile": "RefOnly",
        "thread_safety_class": "SafePure",
        "volatility_class": "NonVolatile"
      },
      "descriptions": {
        "long": null,
        "short": "Inverse of a square matrix",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Returns the matrix inverse of an array",
        "microsoft_url": "https://support.microsoft.com/en-us/office/minverse-function-11f55086-adde-4c9f-8eb9-59da2d72efc6"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "MINVERSE"
        },
        {
          "locale": "bg-BG",
          "name": "MINVERSE"
        },
        {
          "locale": "cs-CZ",
          "name": "MINVERSE"
        },
        {
          "locale": "da-DK",
          "name": "MINVERT"
        },
        {
          "locale": "de-DE",
          "name": "MINVERSE"
        },
        {
          "locale": "el-GR",
          "name": "MINVERSE"
        },
        {
          "locale": "en-AU",
          "name": "MINVERSE"
        },
        {
          "locale": "en-GB",
          "name": "MINVERSE"
        },
        {
          "locale": "en-US",
          "name": "MINVERSE"
        },
        {
          "locale": "es-ES",
          "name": "MINVERSA"
        },
        {
          "locale": "et-EE",
          "name": "MINVERSE"
        },
        {
          "locale": "fi-FI",
          "name": "MKÄÄNTEINEN"
        },
        {
          "locale": "fr-FR",
          "name": "INVERSEMAT*"
        },
        {
          "locale": "he-IL",
          "name": "MINVERSE"
        },
        {
          "locale": "hr-HR",
          "name": "MINVERSE"
        },
        {
          "locale": "hu-HU",
          "name": "INVERZ.MÁTRIX"
        },
        {
          "locale": "id-ID",
          "name": "MINVERSE"
        },
        {
          "locale": "it-IT",
          "name": "MINVERSE"
        },
        {
          "locale": "ja-JP",
          "name": "MINVERSE"
        },
        {
          "locale": "ko-KR",
          "name": "MINVERSE"
        },
        {
          "locale": "lt-LT",
          "name": "MINVERSE"
        },
        {
          "locale": "lv-LV",
          "name": "MINVERSE"
        },
        {
          "locale": "nb-NO",
          "name": "MINVERSE"
        },
        {
          "locale": "nl-NL",
          "name": "INVERSEMAT"
        },
        {
          "locale": "pl-PL",
          "name": "MACIERZ.ODW"
        },
        {
          "locale": "pt-BR",
          "name": "MINVERSE"
        },
        {
          "locale": "pt-PT",
          "name": "MATRIZ.INVERSA"
        },
        {
          "locale": "ro-RO",
          "name": "MINVERSE"
        },
        {
          "locale": "ru-RU",
          "name": "МОБР"
        },
        {
          "locale": "sk-SK",
          "name": "MINVERSE"
        },
        {
          "locale": "sl-SI",
          "name": "MINVERSE"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "MINVERSE"
        },
        {
          "locale": "sv-SE",
          "name": "MINVERT"
        },
        {
          "locale": "th-TH",
          "name": "MINVERSE"
        },
        {
          "locale": "tr-TR",
          "name": "DİZEY_TERS işlevi"
        },
        {
          "locale": "uk-UA",
          "name": "MINVERSE"
        },
        {
          "locale": "vi-VN",
          "name": "MINVERSE"
        },
        {
          "locale": "zh-CN",
          "name": "MINVERSE"
        },
        {
          "locale": "zh-HK",
          "name": "MINVERSE"
        },
        {
          "locale": "zh-TW",
          "name": "MINVERSE"
        }
      ],
      "signature": {
        "display": "MINVERSE(array)",
        "parameters": [
          {
            "description": null,
            "name": "array",
            "optional": false,
            "repeats": false
          }
        ],
        "trailing_repeats": false
      },
      "surface_name": "MINVERSE",
      "version_marker": null,
      "xlcall": {
        "code": "164",
        "symbol": "xlfMinverse"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/minverse-function-11f55086-adde-4c9f-8eb9-59da2d72efc6"
  },
  "try_it": {
    "formula": "=MINVERSE({1,2;3,4})"
  },
  "url": "https://handbook.dnacalc.com/functions/MINVERSE.html",
  "variants": [],
  "versions": [
    {
      "behaviour": "49 captured inputs are indexed for this environment. Capture dates: 2026-07-12 to 2026-07-12. This is a reading count, not a comparison with another build.",
      "excel_build": "16.0 build 20131",
      "platform": "Windows, bitness not recorded, AMD Ryzen 7 4800H with Radeon Graphics",
      "sources": [
        "https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/5dc75391aa5125ccc5abdb095da85950980d6fd8/content/evidence/environments/FUNC.MINVERSE.json"
      ]
    },
    {
      "behaviour": "985 captured inputs are indexed for this environment. Capture dates: 2026-08-09 to 2026-08-09. This is a reading count, not a comparison with another build.",
      "excel_build": "16.0 build 20228",
      "platform": "Windows, 64-bit, CPU not recorded",
      "sources": [
        "https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/5dc75391aa5125ccc5abdb095da85950980d6fd8/content/evidence/environments/FUNC.MINVERSE.json"
      ]
    }
  ]
}