{
  "category": "Statistical functions",
  "display_name": "BINOM.DIST",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.BINOM.DIST",
  "implementation_state": {
    "answer_bank": {
      "excel_builds": [
        "20131",
        "20527",
        "?"
      ],
      "larger_numeric": 58,
      "last_bit": 161,
      "matched": 70130,
      "other_mismatch": 0,
      "refused": 0,
      "rows": 70349,
      "unread": 0,
      "worst_ulp": 761
    },
    "detail": "Of 70,656 recorded answers (70,349 in the answer bank and 307 workbook cells), 303 do not match: 73 differ by more than 16 ULP, 230 differ by at most 16 ULP.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "differs",
    "state_label": "Known larger differences",
    "summary": "Known larger differences on 303 of 70,656 recorded answers",
    "workbook_corpus": {
      "cells": 307,
      "larger_numeric": 15,
      "last_bit": 69,
      "matched": 223,
      "worst_ulp": 10
    }
  },
  "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#L261-L264"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/distributions::nums",
        "ported/discrete_dist::stirling_error",
        "ported/discrete_dist::deviance",
        "ported/discrete_dist::binom_mass",
        "ported/discrete_dist::finite",
        "ported/discrete_dist::binom_dist_kernel",
        "ported/excel_numeric::binary_with",
        "ported/excel_numeric::excel_x87_add",
        "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::add",
        "ported/excel_numeric/x87::sub",
        "ported/excel_numeric/x87::div"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/distributions.rs#L261-L264",
      "state": "differs",
      "suite": null,
      "summary": "Known larger differences on 303 of 70,656 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.BINOM.DIST.json",
  "name": "BINOM.DIST",
  "notes": [],
  "schema": "efh.function-reference/v1",
  "section_order": [
    "what-it-does",
    "try-it",
    "quirks",
    "how-to-implement",
    "version-differences",
    "alternatives"
  ],
  "sections": {
    "alternatives": "\n[BINOM.INV](FUNC.BINOM.INV.md) finds a success-count quantile; [BINOM.DIST.RANGE](FUNC.BINOM.DIST.RANGE.md) covers an interval of counts; [HYPGEOM.DIST](FUNC.HYPGEOM.DIST.md) models sampling without replacement.\n\n\n",
    "how-to-implement": "\nAfter truncating successes `k` and trials `n` toward zero, validate `0<=k<=n` and `0<=p<=1`. The current recorded domain rejects `n>=2147483647` before selecting endpoint shortcuts. At `p=0` or `p=1`, handle the degenerate distribution explicitly; the recorded noncumulative `p=1,k=0,n>0` case gives `#NUM!`, a compatibility exception to the mathematical zero.\n\nFor the **all-success, noncumulative** route `k=n>0`, `0<p<1`:\n\n1. Obtain the stored measured public [LN](FUNC.LN.md#how-to-implement) result for p, called `L`.\n2. Compute `t=R(n*L)` with the [stored-arithmetic recipe](../model/09-staged-arithmetic.md), rounding once to a 64-bit significand and then storing to binary64.\n3. Pass the stored `t` to the measured public [EXP route](FUNC.EXP.md#how-to-implement) and publish its result under the function’s finite/subnormal policy.\n\nWorked `n=3,p=0.5`: `L` is about `-0.6931471805599453`, the stored product is about `-2.0794415416798357`, and this reconstruction’s exponential is `0.12500000000000003`, near the mathematical probability `0.125`. The stored intermediate values explain why the computation need not return the exactly representable mathematical result. A direct `pow(p,n)` has different intermediate stages and is not a substitute for this identified computation tree.\n\nThe all-success stored product is distinguished by 300 numeric discriminants and 256 controls in the cited code. Its scope does not cover the zero-success producer, interior masses or every separately recorded domain answer.\n\nThe later R31 source isolates additional **interior-mass stages**. These start from Loader’s published saddle-point form, then preserve separately measured arithmetic sites. Let `D` mean ordinary binary64 storage and `E` resident 64-bit-significand arithmetic; their [portable definitions](../model/09-staged-arithmetic.md#retain-an-extended-intermediate-when-the-recipe-requires-it) keep E distinct from R.\n\n1. For `0<k<n`, set `q=D(1-p)`. Obtain Stirling correction s and deviance d from the explicit [Poisson helper recipes](FUNC.POISSON.DIST.md#how-to-implement).\n2. Form `c=R(s(n)-s(k))`, then successively `c=R(c-d(k,R(n*p)))`, `c=R(c-s(n-k))` and `c=R(c-d(n-k,R(n*q)))`. Keep this subtraction order. The source records 13,000 controls across six `(n,k)` pairs for that exponent grid.\n3. Form the ordered binary64 terms `[-LN(n)/2,LN(k)/2,LN(n-k)/2,0.9189385332046728]`. Their mathematical effect supplies `sqrt(n/(2*pi*k*(n-k)))` without directly forming that ratio.\n4. Initialize stored a and resident b from c. For each term, update `a=R(a-term)` and separately `b=E(b-term)`, retaining b across the whole list. Compute `lost=D(E(b-a))`, `factor=R(1+lost)`, and return `R(EXP(a)*factor)`.\n\nBINOM uses one correction for the running resident difference. POISSON’s prefactor instead keeps one correction factor for each of its two subtractions. They are distinct reconstructions even though both compensate a stored exponent.\n\nFor `k=3,n=10,p=0.25`, the stated interior reconstruction gives `0.2502822875976563`. Direct exact rational evaluation of `120*(1/4)^3*(3/4)^7` gives the representable mathematical value `0.25028228759765625`. The first number is a worked reconstruction, rather than a new Excel reading or a statement that the candidate is correct on that input.\n\nThe current cumulative route sums masses forward with ordinary binary64 additions and caps the final sum at one; it has its own endpoint shortcuts. A stable recurrence or incomplete-beta CDF is another mathematical algorithm with a different rounding history. The source’s zero-success logarithm remains unidentified, the Stirling table and deviance retain exceptions, and the problem report still records unresolved distribution answers. These stages do not establish whole-function agreement; the separately pinned interactive calculator can also predate the later interior update.\n\n\n",
    "quirks": "\nCounts are truncated toward zero. A probability outside zero to one, or an out-of-range success count, gives `#NUM!`; nonnumeric numeric arguments give `#VALUE!`. “At least k” uses a complement at `k-1`, not at k. The all-success mass and its cumulative endpoint follow different paths.\n\n\n",
    "sources": "\n- [Microsoft: BINOM.DIST function](https://support.microsoft.com/en-us/excel/functions/binom-dist-function), opened 6 November 2026; syntax, documented argument rules and errors.\n- [DnaCalc implementation](https://github.com/DnaCalc/DnaCalc/blob/481f4ab85d3bf5a95b6daf959bb75ccb2f8b40f8/crates/calc-func/src/ported/discrete_dist.rs); implementation steps and the limits identified in the text.\n- [Remaining numerical failures](https://github.com/DnaCalc/DnaCalc/blob/481f4ab85d3bf5a95b6daf959bb75ccb2f8b40f8/docs/generated/problem-functions.md).\n- [R31 running exponential correction](https://github.com/DnaCalc/DnaCalc/blob/481f4ab85d3bf5a95b6daf959bb75ccb2f8b40f8/crates/calc-func/src/ported/excel_numeric/x87_chains.rs); `exp_running`, with resident and stored subtraction chains.\n- [Loader’s published saddle-point method](https://www.r-project.org/doc/reports/CLoader-dbinom-2002.pdf), opened 6 November 2026; mathematical starting form, separate from the measured store identification.\n\n",
    "try-it": "\n`=BINOM.DIST(3,3,0.5,FALSE)` is about `0.125`. `=BINOM.DIST(3,3,0.5,TRUE)` returns `1`, since all possible outcomes have at most three successes.\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 | 70,201 |\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.BINOM.DIST.json).",
    "what-it-does": "\n`BINOM.DIST(number_s, trials, probability_s, cumulative)` describes successes in a fixed number of independent trials with one success probability. FALSE returns exactly that many successes; TRUE returns at most that many.\n\n\n"
  },
  "signature": {
    "display": "BINOM.DIST(number_s, trials, probability_s, cumulative)",
    "parameters": [
      {
        "description": null,
        "name": "number_s",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "trials",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "probability_s",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "cumulative",
        "optional": false,
        "repeats": false
      }
    ],
    "trailing_repeats": false
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "implemented",
        "reason": null
      },
      "arity": {
        "max": 4,
        "min": 4
      },
      "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": "RefOnly",
        "thread_safety_class": "SafePure",
        "volatility_class": "NonVolatile"
      },
      "descriptions": {
        "long": null,
        "short": "Binomial distribution: the chance of a number of successes in a number of trials, as a single value or cumulative",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Returns the individual term binomial distribution probability",
        "microsoft_url": "https://support.microsoft.com/en-us/office/binom-dist-function-c5ae37b6-f39c-4be2-94c2-509a1480770c"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "BINOM.DIST"
        },
        {
          "locale": "bg-BG",
          "name": "BINOM.DIST"
        },
        {
          "locale": "cs-CZ",
          "name": "BINOM.DIST"
        },
        {
          "locale": "da-DK",
          "name": "BINOMIAL.FORDELING"
        },
        {
          "locale": "de-DE",
          "name": "BINOM.DIST"
        },
        {
          "locale": "el-GR",
          "name": "BINOM.DIST"
        },
        {
          "locale": "en-AU",
          "name": "BINOM.DIST"
        },
        {
          "locale": "en-GB",
          "name": "BINOM.DIST"
        },
        {
          "locale": "en-US",
          "name": "BINOM.DIST"
        },
        {
          "locale": "es-ES",
          "name": "DISTR.BINOM.N"
        },
        {
          "locale": "et-EE",
          "name": "BINOM.DIST"
        },
        {
          "locale": "fi-FI",
          "name": "BINOMI.JAKAUMA"
        },
        {
          "locale": "fr-FR",
          "name": "LOI.BINOMIALE.N*"
        },
        {
          "locale": "he-IL",
          "name": "BINOM.DIST"
        },
        {
          "locale": "hr-HR",
          "name": "BINOM.DIST"
        },
        {
          "locale": "hu-HU",
          "name": "BINOM.ELOSZL"
        },
        {
          "locale": "id-ID",
          "name": "BINOM.DIST"
        },
        {
          "locale": "it-IT",
          "name": "BINOM.DIST"
        },
        {
          "locale": "ja-JP",
          "name": "BINOM.DIST"
        },
        {
          "locale": "ko-KR",
          "name": "BINOM.DIST"
        },
        {
          "locale": "lt-LT",
          "name": "BINOM.DIST"
        },
        {
          "locale": "lv-LV",
          "name": "BINOM.DIST"
        },
        {
          "locale": "nb-NO",
          "name": "BINOM.DIST"
        },
        {
          "locale": "nl-NL",
          "name": "BINOM.VERD"
        },
        {
          "locale": "pl-PL",
          "name": "ROZKŁ.DWUM"
        },
        {
          "locale": "pt-BR",
          "name": "BINOM.DIST"
        },
        {
          "locale": "pt-PT",
          "name": "DISTR.BINOM"
        },
        {
          "locale": "ro-RO",
          "name": "BINOM.DIST"
        },
        {
          "locale": "ru-RU",
          "name": "БИНОМ.РАСП"
        },
        {
          "locale": "sk-SK",
          "name": "BINOM.DIST"
        },
        {
          "locale": "sl-SI",
          "name": "BINOM.DIST"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "BINOM.DIST"
        },
        {
          "locale": "sv-SE",
          "name": "BINOM.FÖRD"
        },
        {
          "locale": "th-TH",
          "name": "BINOM.DIST"
        },
        {
          "locale": "tr-TR",
          "name": "BİNOM.DAĞ"
        },
        {
          "locale": "uk-UA",
          "name": "BINOM.DIST"
        },
        {
          "locale": "vi-VN",
          "name": "BINOM.DIST"
        },
        {
          "locale": "zh-CN",
          "name": "BINOM.DIST"
        },
        {
          "locale": "zh-HK",
          "name": "BINOM.DIST"
        },
        {
          "locale": "zh-TW",
          "name": "BINOM.DIST"
        }
      ],
      "signature": {
        "display": "BINOM.DIST(number_s, trials, probability_s, cumulative)",
        "parameters": [
          {
            "description": null,
            "name": "number_s",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "trials",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "probability_s",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "cumulative",
            "optional": false,
            "repeats": false
          }
        ],
        "trailing_repeats": false
      },
      "surface_name": "BINOM.DIST",
      "version_marker": null,
      "xlcall": {
        "code": "486",
        "symbol": "xlfBinom_dist"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/binom-dist-function-c5ae37b6-f39c-4be2-94c2-509a1480770c"
  },
  "try_it": {
    "formula": "=BINOM.DIST(3,3,0.5,FALSE)"
  },
  "url": "https://handbook.dnacalc.com/functions/BINOM.DIST.html",
  "variants": [],
  "versions": [
    {
      "behaviour": "70,201 captured inputs are indexed for this environment. Capture dates: 2026-07-17 to 2026-07-18. 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.BINOM.DIST.json"
      ]
    }
  ]
}