{
  "category": "Statistical functions",
  "display_name": "BETA.INV",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.BETA.INV",
  "implementation_state": {
    "answer_bank": null,
    "detail": "Everything else matches (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: 1 of 6 recorded answers differ in the last bits, worst 2 ULP",
    "workbook_corpus": {
      "cells": 6,
      "last_bit": 1,
      "matched": 5,
      "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#L211-L216"
      ],
      "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#L211-L216",
      "state": "close",
      "suite": null,
      "summary": "Close: 1 of 6 recorded answers differ in the last bits, worst 2 ULP"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.BETA.INV.json",
  "name": "BETA.INV",
  "notes": [],
  "schema": "efh.function-reference/v1",
  "section_order": [
    "what-it-does",
    "try-it",
    "quirks",
    "how-to-implement",
    "version-differences",
    "alternatives"
  ],
  "sections": {
    "alternatives": "\n[BETA.DIST](FUNC.BETA.DIST.md) evaluates the forward CDF or density. [BETAINV](FUNC.BETAINV.md) is the compatibility spelling. [F.INV](FUNC.F.INV.md) and [T.INV](FUNC.T.INV.md) use related beta-ratio mathematics with distinct wrappers.\n\n\n",
    "how-to-implement": "\n1. Apply optional bounds and validate finite positive shapes, finite ordered bounds and probability under the chosen endpoint contract.\n2. Use the current regularized lower beta callback F(z), including its stored complement `1-z` and internal beta-ratio approximation.\n3. Search z between zero and one by bisecting the ordered nonnegative binary64 encodings. At each midpoint, keep the upper half when F(z) is below p and the lower half otherwise. Return the upper endpoint once adjacent, as in [BETAINV’s detailed search recipe](FUNC.BETAINV.md#how-to-implement).\n4. Store `width=B-A`, `scaled=z*width` and `result=A+scaled` with ordinary binary64 arithmetic and separate multiplication/addition. Apply the worksheet’s numeric publication rule.\n\nIn the first example, z is about one half and the last three stages give width four, scaled two and result four. An arithmetic-midpoint search, a residual tolerance, an FMA or an explicit endpoint shortcut can change stored results and boundary behaviour.\n\nAt p=0 the usual strict lower-bracket invariant already fails at z=0. The current search can select the smallest positive binary64 value rather than exactly zero. A mathematical inverse can handle that endpoint explicitly; reproducing this code instead requires retaining its search and publication stages.\n\nInverse accuracy depends on the forward surface being searched. A round trip through that same surface can hide a shared error. The beta approximation, extreme affine scaling and remaining inverse mismatches are still open; there is no published whole-function Handbook suite.\n\n\n",
    "quirks": "\nMicrosoft documents `#VALUE!` for nonnumeric arguments and `#NUM!` for nonpositive shapes or probability at/below zero or above one. The current implementation also rejects unordered bounds.\n\nThe current helper’s validation admits zero probability but has no zero-endpoint shortcut before searching adjacent binary64 values. On the standard interval this can leave a subnormal value that its publisher refuses; on two to six the affine addition rounds it to two. This code-path behaviour is not a measurement of Excel’s endpoint.\n\nThe legacy BETAINV shares the current helper. Shared code does not establish that all Excel builds compute the two names identically.\n\n\n",
    "sources": "\n- [Microsoft: BETA.INV function](https://support.microsoft.com/en-us/excel/functions/beta-inv-function), opened 7 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 callback and ordered-value inverse](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`=BETA.INV(0.25,2,1,2,6)` is about `4`. On the standard interval, these shapes give CDF `z^2`; probability one quarter therefore selects z one half. Rescaling gives `2+0.5*4=4`.\n\n`=BETA.INV(0.25,1,1,2,6)` is about `3`: the uniform shape-one case has CDF z itself.\n\n\n",
    "version-differences": "\nNo same-input comparison between named Excel builds is recorded for this function here. The documented behaviour below is not a measurement of every Excel release.\n\n\n",
    "what-it-does": "\n`BETA.INV(probability,alpha,beta,[A],[B])` returns the value whose beta CDF is the requested probability. Shapes alpha and beta are positive. Bounds default to zero and one; supplying other bounds rescales the value interval, while probability remains on zero to one.\n\n\n"
  },
  "signature": {
    "display": "BETA.INV(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": "Statistical functions",
      "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": "The value at which the cumulative beta distribution reaches a given probability",
        "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/beta-inv-function-e84cb8aa-8df0-4cf6-9892-83a341d252eb"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "BETA.INVn"
        },
        {
          "locale": "bg-BG",
          "name": "BETA.INVn"
        },
        {
          "locale": "cs-CZ",
          "name": "BETA.INVn"
        },
        {
          "locale": "da-DK",
          "name": "BETA.INVn"
        },
        {
          "locale": "de-DE",
          "name": "BETA.INVn"
        },
        {
          "locale": "el-GR",
          "name": "BETA.INVn"
        },
        {
          "locale": "en-AU",
          "name": "BETA.INVn"
        },
        {
          "locale": "en-GB",
          "name": "BETA.INVn"
        },
        {
          "locale": "en-US",
          "name": "BETA.INVn"
        },
        {
          "locale": "es-ES",
          "name": "BETA.INVn"
        },
        {
          "locale": "et-EE",
          "name": "BETA.INVn"
        },
        {
          "locale": "fi-FI",
          "name": "BEETA. KÄÄNT"
        },
        {
          "locale": "fr-FR",
          "name": "BETA.INVn"
        },
        {
          "locale": "he-IL",
          "name": "BETA.INVn"
        },
        {
          "locale": "hr-HR",
          "name": "BETA.INVn"
        },
        {
          "locale": "hu-HU",
          "name": "INVERZ.BÉTA"
        },
        {
          "locale": "id-ID",
          "name": "BETA.INVn"
        },
        {
          "locale": "it-IT",
          "name": "BETA.INVn"
        },
        {
          "locale": "ja-JP",
          "name": "BETA.INVn"
        },
        {
          "locale": "ko-KR",
          "name": "BETA.INVn"
        },
        {
          "locale": "lt-LT",
          "name": "BETA.INVn"
        },
        {
          "locale": "lv-LV",
          "name": "BETA.INVn"
        },
        {
          "locale": "nb-NO",
          "name": "BETA.INVn"
        },
        {
          "locale": "nl-NL",
          "name": "BETA.INVn"
        },
        {
          "locale": "pl-PL",
          "name": "BETA.INVn"
        },
        {
          "locale": "pt-BR",
          "name": "BETA. INVn"
        },
        {
          "locale": "pt-PT",
          "name": "BETA. INVN"
        },
        {
          "locale": "ro-RO",
          "name": "BETA.INVn"
        },
        {
          "locale": "ru-RU",
          "name": "BETA.INVn"
        },
        {
          "locale": "sk-SK",
          "name": "BETA.INVn"
        },
        {
          "locale": "sl-SI",
          "name": "BETA.INVn"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "BETA.INVn"
        },
        {
          "locale": "sv-SE",
          "name": "BETA.INVn"
        },
        {
          "locale": "th-TH",
          "name": "BETA.INVn"
        },
        {
          "locale": "tr-TR",
          "name": "BETA.INVn"
        },
        {
          "locale": "uk-UA",
          "name": "BETA.INVn"
        },
        {
          "locale": "vi-VN",
          "name": "BETA.INVn"
        },
        {
          "locale": "zh-CN",
          "name": "BETA.INVn"
        },
        {
          "locale": "zh-HK",
          "name": "BETA.INVn"
        },
        {
          "locale": "zh-TW",
          "name": "BETA.INVn"
        }
      ],
      "signature": {
        "display": "BETA.INV(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": "BETA.INV",
      "version_marker": null,
      "xlcall": {
        "code": "526",
        "symbol": "xlfBeta_inv"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/beta-inv-function-e84cb8aa-8df0-4cf6-9892-83a341d252eb"
  },
  "try_it": {
    "formula": "=BETA.INV(0.25,2,1,2,6)"
  },
  "url": "https://handbook.dnacalc.com/functions/BETA.INV.html",
  "variants": [],
  "versions": []
}