{
  "category": "Compatibility",
  "display_name": "CHIINV",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.CHIINV",
  "implementation_state": {
    "answer_bank": {
      "excel_builds": [
        "20131",
        "?"
      ],
      "larger_numeric": 3,
      "last_bit": 66,
      "matched": 31,
      "other_mismatch": 0,
      "refused": 0,
      "rows": 100,
      "unread": 0,
      "worst_ulp": 91
    },
    "detail": "Of 104 recorded answers (100 in the answer bank and 4 workbook cells), 69 do not match: 3 differ by more than 16 ULP, 66 differ by at most 16 ULP.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "differs",
    "state_label": "Known larger differences",
    "summary": "Known larger differences on 69 of 104 recorded answers",
    "workbook_corpus": {
      "cells": 4,
      "matched": 4
    }
  },
  "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/distributions.rs#L132-L135"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/distributions::nums",
        "ported/chi_f_t_family::truncate_positive_integer",
        "ported/chi_f_t_family::validate_probability_open_unit",
        "ported/chi_f_t_family::search_upper_bound",
        "ported/chi_f_t_family::chisq_inv_rt_kernel",
        "ported/excel_numeric::binary_with",
        "ported/excel_numeric::excel_expm1_internal",
        "ported/excel_numeric::expm1_internal_graph",
        "ported/excel_numeric::excel_x87_sub",
        "ported/excel_numeric::excel_x87_mul",
        "ported/excel_numeric::excel_x87_temme_finish",
        "ported/excel_numeric::excel_x87_div",
        "ported/excel_numeric/x87::mul",
        "ported/excel_numeric/x87::sub",
        "ported/excel_numeric/x87::div",
        "ported/excel_numeric/x87_chains::pow2_positive",
        "ported/excel_numeric/x87_chains::pow2",
        "ported/excel_numeric/x87_chains::exp_ext",
        "ported/excel_numeric/x87_chains::exp_with",
        "ported/excel_numeric/x87_chains::excel_exp",
        "ported/excel_numeric/x87_chains::log_with",
        "ported/excel_numeric/x87_chains::excel_log",
        "ported/special_math_common::gratio_norm_gamma",
        "ported/special_math_common::gratio_rexp",
        "ported/special_math_common::gratio_rlog",
        "ported/special_math_common::gratio_gam1",
        "ported/special_math_common::gratio",
        "ported/special_math_common::series_prefactor",
        "ported/special_math_common::gratio_after40",
        "ported/special_math_common::gratio_cf",
        "ported/special_math_common::gratio_temme_270",
        "ported/special_math_common::gratio_temme_340",
        "ported/special_math_common::gratio_temme_330",
        "ported/special_math_common::gratio_temme_finish",
        "ported/special_math_common::regularized_gamma_q",
        "ported/special_math_common::bisect_inverse"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/distributions.rs#L132-L135",
      "state": "differs",
      "suite": null,
      "summary": "Known larger differences on 69 of 104 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.CHIINV.json",
  "name": "CHIINV",
  "notes": [],
  "schema": "efh.function-reference/v1",
  "section_order": [
    "what-it-does",
    "try-it",
    "quirks",
    "how-to-implement",
    "version-differences",
    "alternatives"
  ],
  "sections": {
    "alternatives": "\n[CHISQ.DIST.RT](FUNC.CHISQ.DIST.RT.md) supplies the forward probability; [CHISQ.TEST](FUNC.CHISQ.TEST.md) returns a test p-value directly.\n\n\n",
    "how-to-implement": "\nThe current candidate inverts the decreasing regularized upper gamma ratio `Q(k/2,x/2)` directly. Do not first replace p by `1-p`: a tiny p can disappear in that subtraction.\n\n1. Truncate and validate k and require `0<p<1`. Let `H(x)=-Q(k/2,x/2)` and `target=-p`, making H increasing.\n2. Set `lo=0,hi=max(k,1)`. While `H(hi)<target`, double hi, with the source’s limit of 200 expansion checks.\n3. For nonnegative finite binary64 values, their unsigned 64-bit encodings have the same order as their values. Let L and U be the encodings of lo and hi. While `U-L>1`, take the integer midpoint `M=L+(U-L)//2`, decode it to x, and evaluate H(x). If `H(x)>=target`, set U=M; otherwise set L=M.\n4. Decode and return U. This chooses the upper endpoint of the maintained adjacent-value bracket, rather than a floating arithmetic midpoint or a nearest-root rounding rule.\n\nAt k=2 the mathematical right tail is `exp(-x/2)`. Setting it to one half gives about `1.38629436111989`. In the current code, however, this inverse callback remains the generic upper-gamma ratio; it does not call the public right-tail wrapper’s separate df=1 ERFC and df=2 EXP branches.\n\nThis is an implementable description of the current search, conditional on its numerical forward callback. That callback’s approximation and monotonic behaviour, its remaining mismatches and whole-domain Excel return choices are separate unresolved questions.\n\n\n",
    "quirks": "\nDegrees of freedom are truncated. Nonnumeric arguments give `#VALUE!`; invalid degrees or probabilities give `#NUM!`. The current helper accepts truncated degrees from one through `10^10` and requires `0<p<1`; it rejects both probability endpoints.\n\nThe opened Microsoft page describes an out-of-range probability test below zero or above one, and degrees below one. It also documents `#N/A` after 100 unsuccessful search iterations. Those statements are documentation, rather than evidence that the current shared search has the same guards or iteration counter. The companion CHISQ.INV.RT page documents 64 iterations; this wording difference does not establish a measured change between Excel builds.\n\n\n",
    "sources": "\n- [Microsoft: CHIINV function](https://support.microsoft.com/en-us/excel/functions/chiinv-function), opened 6 November 2026; syntax, documented argument rules and errors.\n- [DnaCalc implementation](https://github.com/DnaCalc/DnaCalc/blob/da3ecc4fb19a3a5529708c311d0e8f05688ac165/crates/calc-func/src/ported/chi_f_t_family.rs); implementation steps and the limits identified in the text.\n- [Ordered-value inverse search](https://github.com/DnaCalc/DnaCalc/blob/da3ecc4fb19a3a5529708c311d0e8f05688ac165/crates/calc-func/src/ported/special_math_common.rs); `bisect_inverse`, upper-gamma callback and numerical limits.\n\n",
    "try-it": "\n`=CHIINV(0.5,2)` is about `1.38629436111989`. At two degrees of freedom, a half right tail solves `exp(-x/2)=0.5`; the same point also has a half left CDF.\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| 19929 | Windows, bitness not recorded, CPU not recorded | 14 |\n| 20131 | Windows, bitness not recorded, AMD Ryzen 7 4800H with Radeon Graphics | 100 |\n\n- XC-CHIINV-001: build 19929 versus build 20131; 5 same-input pairs, 0 differing answers. Compared axes: excel-build. Numeric answers were compared by their recorded binary64 bits; other answers by typed value.\n\nAgreement on these compared inputs does not establish agreement on unmeasured inputs.\n\n[Recorded environments and comparison details](https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/5dc75391aa5125ccc5abdb095da85950980d6fd8/content/evidence/environments/FUNC.CHIINV.json).",
    "what-it-does": "\n`CHIINV(probability, deg_freedom)` finds the chi-square value whose right-tail probability is the requested value. CHIINV is the compatibility right-tail inverse.\n\n\n"
  },
  "signature": {
    "display": "CHIINV(probability, deg_freedom)",
    "parameters": [
      {
        "description": null,
        "name": "probability",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "deg_freedom",
        "optional": false,
        "repeats": false
      }
    ],
    "trailing_repeats": false
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "implemented",
        "reason": null
      },
      "arity": {
        "max": 2,
        "min": 2
      },
      "category": "Compatibility",
      "classification": {
        "arg_preparation_profile": "ValuesOnlyPreAdapter",
        "coercion_lift_profile": "Custom",
        "determinism_class": "Deterministic",
        "error_collapse_profile": "None",
        "fec_dependency_profile": "None",
        "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 the right-tail chi-squared probability (older form)",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Returns the inverse of the one-tailed probability of the chi-squared distribution",
        "microsoft_url": "https://support.microsoft.com/en-us/office/chiinv-function-cfbea3f6-6e4f-40c9-a87f-20472e0512af"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "CHIINV"
        },
        {
          "locale": "bg-BG",
          "name": "CHIINV"
        },
        {
          "locale": "cs-CZ",
          "name": "CHIINV"
        },
        {
          "locale": "da-DK",
          "name": "CHIINV"
        },
        {
          "locale": "de-DE",
          "name": "CHIINV"
        },
        {
          "locale": "el-GR",
          "name": "CHIINV"
        },
        {
          "locale": "en-AU",
          "name": "CHIINV"
        },
        {
          "locale": "en-GB",
          "name": "CHIINV"
        },
        {
          "locale": "en-US",
          "name": "CHIINV"
        },
        {
          "locale": "es-ES",
          "name": "PRUEBA.CHI.INV"
        },
        {
          "locale": "et-EE",
          "name": "CHIINV"
        },
        {
          "locale": "fi-FI",
          "name": "CHIJAKAUMA.KÄÄNT"
        },
        {
          "locale": "fr-FR",
          "name": "KHIDEUX.INVERSE*"
        },
        {
          "locale": "he-IL",
          "name": "CHIINV"
        },
        {
          "locale": "hr-HR",
          "name": "CHIINV"
        },
        {
          "locale": "hu-HU",
          "name": "INVERZ.KHI"
        },
        {
          "locale": "id-ID",
          "name": "CHIINV"
        },
        {
          "locale": "it-IT",
          "name": "CHIINV"
        },
        {
          "locale": "ja-JP",
          "name": "CHIINV"
        },
        {
          "locale": "ko-KR",
          "name": "CHIINV"
        },
        {
          "locale": "lt-LT",
          "name": "CHIINV"
        },
        {
          "locale": "lv-LV",
          "name": "CHIINV"
        },
        {
          "locale": "nb-NO",
          "name": "CHIINV"
        },
        {
          "locale": "nl-NL",
          "name": "CHI.KWADRAAT.INV"
        },
        {
          "locale": "pl-PL",
          "name": "ROZKŁAD.CHI.ODW"
        },
        {
          "locale": "pt-BR",
          "name": "QUIINV"
        },
        {
          "locale": "pt-PT",
          "name": "INV.CHI"
        },
        {
          "locale": "ro-RO",
          "name": "CHIINV"
        },
        {
          "locale": "ru-RU",
          "name": "ХИ2ОБР"
        },
        {
          "locale": "sk-SK",
          "name": "CHIINV"
        },
        {
          "locale": "sl-SI",
          "name": "CHIINV"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "CHIINV"
        },
        {
          "locale": "sv-SE",
          "name": "CHI2INV"
        },
        {
          "locale": "th-TH",
          "name": "CHIINV"
        },
        {
          "locale": "tr-TR",
          "name": "KİKARETERS işlevi"
        },
        {
          "locale": "uk-UA",
          "name": "CHIINV"
        },
        {
          "locale": "vi-VN",
          "name": "CHIINV"
        },
        {
          "locale": "zh-CN",
          "name": "CHIINV"
        },
        {
          "locale": "zh-HK",
          "name": "CHIINV"
        },
        {
          "locale": "zh-TW",
          "name": "CHIINV"
        }
      ],
      "signature": {
        "display": "CHIINV(probability, deg_freedom)",
        "parameters": [
          {
            "description": null,
            "name": "probability",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "deg_freedom",
            "optional": false,
            "repeats": false
          }
        ],
        "trailing_repeats": false
      },
      "surface_name": "CHIINV",
      "version_marker": null,
      "xlcall": {
        "code": "275",
        "symbol": "xlfChiinv"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/chiinv-function-cfbea3f6-6e4f-40c9-a87f-20472e0512af"
  },
  "try_it": {
    "formula": "=CHIINV(0.5,2)"
  },
  "url": "https://handbook.dnacalc.com/functions/CHIINV.html",
  "variants": [],
  "versions": [
    {
      "behaviour": "14 captured inputs are indexed for this environment. Capture dates are not recorded. This is a reading count, not a comparison with another build.",
      "excel_build": "16.0 build 19929",
      "platform": "Windows, bitness not recorded, CPU not recorded",
      "sources": [
        "https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/5dc75391aa5125ccc5abdb095da85950980d6fd8/content/evidence/environments/FUNC.CHIINV.json"
      ]
    },
    {
      "behaviour": "100 captured inputs are indexed for this environment. Capture dates: 2026-07-17 to 2026-07-17. 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.CHIINV.json"
      ]
    }
  ]
}