{
  "category": "Compatibility",
  "display_name": "BETAINV",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.BETAINV",
  "implementation_state": {
    "answer_bank": {
      "excel_builds": [
        "20131",
        "?"
      ],
      "larger_numeric": 0,
      "last_bit": 44,
      "matched": 18,
      "other_mismatch": 0,
      "refused": 0,
      "rows": 62,
      "unread": 0,
      "worst_ulp": 12
    },
    "detail": "Everything else matches (62 in the answer bank and 6 workbook cells). Last-bit means a finite number within 16 ULP of Excel's.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "close",
    "state_label": "Close: last-bit deviations remain",
    "summary": "Close: 46 of 68 recorded answers differ in the last bits, worst 12 ULP",
    "workbook_corpus": {
      "cells": 6,
      "last_bit": 2,
      "matched": 4,
      "worst_ulp": 2
    }
  },
  "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#L217-L222"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/distributions::nums",
        "ported/beta_gamma_stats_family::validate_beta_shape",
        "ported/beta_gamma_stats_family::beta_inv_kernel",
        "ported/excel_numeric::binary_with",
        "ported/excel_numeric::excel_x87_add",
        "ported/excel_numeric::excel_x87_mul",
        "ported/excel_numeric::excel_x87_mul_add",
        "ported/excel_numeric/x87::mul",
        "ported/excel_numeric/x87::add",
        "ported/special_math_common::bratio_ftoi",
        "ported/special_math_common::bratio_spmpar1",
        "ported/special_math_common::bratio_exparg",
        "ported/special_math_common::bratio_esum",
        "ported/special_math_common::bratio_esum20",
        "ported/special_math_common::bratio_alnrel",
        "ported/special_math_common::bratio_rlog1",
        "ported/special_math_common::bratio_gam1",
        "ported/special_math_common::bratio_gamln1",
        "ported/special_math_common::bratio_gamln",
        "ported/special_math_common::bratio_algdiv",
        "ported/special_math_common::bratio_bcorr",
        "ported/special_math_common::bratio_gsumln",
        "ported/special_math_common::bratio_betaln",
        "ported/special_math_common::bratio_betaln_60",
        "ported/special_math_common::bratio_erf_nswc",
        "ported/special_math_common::bratio_erfc1",
        "ported/special_math_common::bratio_rexp",
        "ported/special_math_common::bratio_psi",
        "ported/special_math_common::bratio_fpser",
        "ported/special_math_common::bratio_apser",
        "ported/special_math_common::bratio_bpser",
        "ported/special_math_common::bratio_bup",
        "ported/special_math_common::bratio_brcomp",
        "ported/special_math_common::bratio_brcmp1",
        "ported/special_math_common::bratio_bfrac",
        "ported/special_math_common::bratio_bgrat",
        "ported/special_math_common::bratio_grat1",
        "ported/special_math_common::bratio_basym",
        "ported/special_math_common::bratio",
        "ported/special_math_common::regularized_beta",
        "ported/special_math_common::bisect_inverse"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/distributions.rs#L217-L222",
      "state": "close",
      "suite": null,
      "summary": "Close: 46 of 68 recorded answers differ in the last bits, worst 12 ULP"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.BETAINV.json",
  "name": "BETAINV",
  "notes": [],
  "schema": "efh.function-reference/v1",
  "section_order": [
    "what-it-does",
    "try-it",
    "quirks",
    "how-to-implement",
    "version-differences",
    "alternatives"
  ],
  "sections": {
    "alternatives": "\n[BETA.INV](FUNC.BETA.INV.md) is the current spelling. [BETADIST](FUNC.BETADIST.md) reverses the value/probability direction.\n\n\n",
    "how-to-implement": "\n1. Validate positive finite shapes, finite ordered bounds and the current helper’s probability range. Retain the documented legacy endpoint distinction above.\n2. Search z on `[0,1]` using the current regularized lower beta ratio `F(z)`. The source uses the [ordered-binary64 inverse search](FUNC.CHISQ.INV.RT.md#how-to-implement), with this increasing forward function and target p: bisect the endpoint encodings until adjacent and return the upper one.\n3. Keep the callback unchanged. Its interior call supplies `bratio(alpha,beta,z,D(1-z))`; an independently substituted beta routine changes the surface being inverted.\n4. Using ordinary binary64 stores, form `width=D(B-A)`, `scaled=D(z*width)` and `result=D(A+scaled)`. Apply worksheet publication. Do not contract the final multiplication and addition into an FMA.\n\nWith both shapes one, p=0.25 gives z about one quarter, width four and result three. With shapes two and one, `F(z)=z^2`; z about one half gives result four on the same interval.\n\nFor p=0, the current search’s usual strict lower-bracket invariant does not hold: its forward value at zero already equals the target. Without an endpoint shortcut the nonnegative encoding search can terminate at the smallest positive binary64 value. That explains the interval-dependent publication described above; it is a code-path analysis, not an Excel measurement.\n\nA mathematical implementation can handle p=0 explicitly or use a safeguarded Newton/bisection method. Those are different endpoint and stopping policies. Current beta forward errors, stored affine stages and remaining inverse mismatches still need their own comparisons before a whole-function claim.\n\n\n",
    "quirks": "\nNonpositive shapes and invalid bounds give `#NUM!`; nonnumeric arguments give `#VALUE!`. Microsoft’s legacy page excludes probability zero and admits one.\n\nThe current shared helper’s validation accepts `[0,1]`, but that is not a promise that probability zero publishes the lower bound in every interval. It has no explicit zero shortcut before its adjacent-value search. On the standard interval this can leave a subnormal result that the current publisher refuses; on two to six, the affine addition rounds the same tiny search value to two. A preview refusal describes the implementation’s limit, rather than a recorded Excel error.\n\nThe inverse’s result is a value in the supplied interval, not another probability. A and B are value bounds, while p remains on the probability scale.\n\n\n",
    "sources": "\n- [Microsoft: BETAINV function](https://support.microsoft.com/en-us/excel/functions/betainv-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/beta_gamma_stats_family.rs); implementation steps and the limits identified in the text.\n- [Beta ratio and ordered-value search](https://github.com/DnaCalc/DnaCalc/blob/da3ecc4fb19a3a5529708c311d0e8f05688ac165/crates/calc-func/src/ported/special_math_common.rs); `regularized_beta` and `bisect_inverse`.\n\n",
    "try-it": "\n`=BETAINV(0.25,1,1,2,6)` is about `3`. The shape-one beta is uniform on the interval two to six; one quarter of the interval reaches three.\n\n`=BETAINV(0.25,2,1,2,6)` is about `4`. Its standard CDF is `z^2`, so probability one quarter selects z one half, then `2+4*z=4`.\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 | 71 |\n| 20131 | Windows, bitness not recorded, AMD Ryzen 7 4800H with Radeon Graphics | 62 |\n\n- XC-BETAINV-001: build 19929 versus build 20131; 2 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.BETAINV.json).",
    "what-it-does": "\n`BETAINV(probability, alpha, beta, [A], [B])` finds a value whose cumulative beta probability is the requested probability. The two positive shape parameters control the distribution, and optional bounds A and B default to zero and one. This is a compatibility name.\n\n\n"
  },
  "signature": {
    "display": "BETAINV(probability, alpha, beta, [A], [B])",
    "parameters": [
      {
        "description": null,
        "name": "probability",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "alpha",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "beta",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "A",
        "optional": true,
        "repeats": false
      },
      {
        "description": null,
        "name": "B",
        "optional": true,
        "repeats": false
      }
    ],
    "trailing_repeats": false
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "implemented",
        "reason": null
      },
      "arity": {
        "max": 5,
        "min": 3
      },
      "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": "None",
        "thread_safety_class": "SafePure",
        "volatility_class": "NonVolatile"
      },
      "descriptions": {
        "long": null,
        "short": "Inverse of the cumulative beta distribution (the older form of BETA.INV)",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Returns the inverse of the cumulative distribution function for a specified beta distribution",
        "microsoft_url": "https://support.microsoft.com/en-us/office/betainv-function-8b914ade-b902-43c1-ac9c-c05c54f10d6c"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "BETAINV"
        },
        {
          "locale": "bg-BG",
          "name": "BETAINV"
        },
        {
          "locale": "cs-CZ",
          "name": "BETAINV"
        },
        {
          "locale": "da-DK",
          "name": "BETAINV"
        },
        {
          "locale": "de-DE",
          "name": "BETAINV"
        },
        {
          "locale": "el-GR",
          "name": "BETAINV"
        },
        {
          "locale": "en-AU",
          "name": "BETAINV"
        },
        {
          "locale": "en-GB",
          "name": "BETAINV"
        },
        {
          "locale": "en-US",
          "name": "BETAINV"
        },
        {
          "locale": "es-ES",
          "name": "DISTR.BETA.INV"
        },
        {
          "locale": "et-EE",
          "name": "BETAINV"
        },
        {
          "locale": "fi-FI",
          "name": "BEETAJAKAUMA.KÄÄNT"
        },
        {
          "locale": "fr-FR",
          "name": "BETA.INVERSE*"
        },
        {
          "locale": "he-IL",
          "name": "BETAINV"
        },
        {
          "locale": "hr-HR",
          "name": "BETAINV"
        },
        {
          "locale": "hu-HU",
          "name": "INVERZ.BÉTA"
        },
        {
          "locale": "id-ID",
          "name": "BETAINV"
        },
        {
          "locale": "it-IT",
          "name": "BETAINV"
        },
        {
          "locale": "ja-JP",
          "name": "BETAINV"
        },
        {
          "locale": "ko-KR",
          "name": "BETAINV"
        },
        {
          "locale": "lt-LT",
          "name": "BETAINV"
        },
        {
          "locale": "lv-LV",
          "name": "BETAINV"
        },
        {
          "locale": "nb-NO",
          "name": "BETAINV"
        },
        {
          "locale": "nl-NL",
          "name": "BETAINV"
        },
        {
          "locale": "pl-PL",
          "name": "ROZKŁAD.BETA.ODW"
        },
        {
          "locale": "pt-BR",
          "name": "BETAINV"
        },
        {
          "locale": "pt-PT",
          "name": "BETA.ACUM.INV"
        },
        {
          "locale": "ro-RO",
          "name": "BETAINV"
        },
        {
          "locale": "ru-RU",
          "name": "БЕТАОБР"
        },
        {
          "locale": "sk-SK",
          "name": "BETAINV"
        },
        {
          "locale": "sl-SI",
          "name": "BETAINV"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "BETAINV"
        },
        {
          "locale": "sv-SE",
          "name": "BETAINV"
        },
        {
          "locale": "th-TH",
          "name": "BETAINV"
        },
        {
          "locale": "tr-TR",
          "name": "BETATERS işlevi"
        },
        {
          "locale": "uk-UA",
          "name": "BETAINV"
        },
        {
          "locale": "vi-VN",
          "name": "BETAINV"
        },
        {
          "locale": "zh-CN",
          "name": "BETAINV"
        },
        {
          "locale": "zh-HK",
          "name": "BETAINV"
        },
        {
          "locale": "zh-TW",
          "name": "BETAINV"
        }
      ],
      "signature": {
        "display": "BETAINV(probability, alpha, beta, [A], [B])",
        "parameters": [
          {
            "description": null,
            "name": "probability",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "alpha",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "beta",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "A",
            "optional": true,
            "repeats": false
          },
          {
            "description": null,
            "name": "B",
            "optional": true,
            "repeats": false
          }
        ],
        "trailing_repeats": false
      },
      "surface_name": "BETAINV",
      "version_marker": null,
      "xlcall": {
        "code": "272",
        "symbol": "xlfBetainv"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/betainv-function-8b914ade-b902-43c1-ac9c-c05c54f10d6c"
  },
  "try_it": {
    "formula": "=BETAINV(0.25,1,1,2,6)"
  },
  "url": "https://handbook.dnacalc.com/functions/BETAINV.html",
  "variants": [],
  "versions": [
    {
      "behaviour": "71 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.BETAINV.json"
      ]
    },
    {
      "behaviour": "62 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.BETAINV.json"
      ]
    }
  ]
}