{
  "category": "Statistical functions",
  "display_name": "CONFIDENCE.NORM",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.CONFIDENCE.NORM",
  "implementation_state": {
    "answer_bank": null,
    "detail": "Everything else matches (5 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 5 recorded answers differ in the last bits, worst 2 ULP",
    "workbook_corpus": {
      "cells": 5,
      "last_bit": 1,
      "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#L101-L104"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/distributions::nums",
        "ported/excel_numeric::binary_with",
        "ported/excel_numeric::excel_x87_mul",
        "ported/excel_numeric/x87::mul",
        "ported/normal_dist_common::phi_kernel",
        "ported/normal_log_family::validate_probability_open_unit",
        "ported/normal_log_family::inverse_standard_normal_acklam_refined",
        "ported/normal_log_family::inverse_standard_normal",
        "ported/normal_log_family::confidence_norm_kernel"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/distributions.rs#L101-L104",
      "state": "close",
      "suite": null,
      "summary": "Close: 1 of 5 recorded answers differ in the last bits, worst 2 ULP"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.CONFIDENCE.NORM.json",
  "name": "CONFIDENCE.NORM",
  "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- **[CONFIDENCE.T](FUNC.CONFIDENCE.T.md)** — the sibling for an *estimated* standard deviation. The\n  two differ by exactly one substitution: `z_{1−α/2}` becomes `t_{1−α/2, n−1}`. Because\n  `t_{q,ν} > z_q` for every finite `ν`, `CONFIDENCE.T` is always the wider of the two on the same\n  inputs, converging to `CONFIDENCE.NORM` as `n → ∞`. Choosing the normal form when the spread came\n  from the sample understates the interval, and for small `n` it understates it badly.\n- **[NORM.S.INV](FUNC.NORM.S.INV.md)** — the quantile this function calls.\n  `CONFIDENCE.NORM(α, σ, n)` and `NORM.S.INV(1 − α/2) * σ / SQRT(n)` are the same expression; the\n  second is the one to use when you want to see the pieces.\n- **[Z.TEST](FUNC.Z.TEST.md)** — the hypothesis test that pairs with this interval.\n- **Confused with**: `CONFIDENCE.NORM` is not a margin *of a proportion*. Applying it to a\n  proportion requires `σ = √(p(1−p))`, which the function will not compute for you.\n\n\n",
    "how-to-implement": "\n### Numerical notes\n\n\nThe whole numerical difficulty is `Φ⁻¹`, and it is a genuinely hard function to evaluate well.\n\n- **Why it is hard.** `Φ⁻¹(q)` has infinite slope at both ends of `(0,1)` and the naive route —\n  invert `erf` by iteration on a series for `Φ` — loses relative accuracy in the tails, where the\n  quantity of interest is large and the probability that determines it is tiny. Every digit of `q`\n  near `1` is worth a great deal of `z`, so cancellation in forming `1 − α/2` is a real hazard.\n- **The literature.** Abramowitz & Stegun chapter 26 gives the classical rational approximations\n  (26.2.22, 26.2.23) with their absolute-error bounds — good enough for tables, not for double\n  precision. The modern standard is Wichura's AS 241 (`PPND16`), accurate to about 16 significant\n  digits over the whole open interval; Moro's and Acklam's approximations are the usual fast\n  alternatives, and Cephes and Boost both carry well-tested `ndtri`/`erfc_inv` routines. Anyone\n  implementing this function is really choosing among those.\n- **The rest is trivial and still worth care.** `σ/√n` is one square root and one division. Forming\n  `z · σ / √n` as `(z * σ) / sqrt(n)` and as `z * (σ / sqrt(n))` differ in the last bit; a\n  compatibility implementation has to pick the same association Excel picks, and the Handbook does\n  not know which that is.\n- **Truncation before the square root.** Because `size` is truncated first, the divisor is\n  `√⌊n⌋`, not `√n`. An implementation that truncates after taking the root would agree on integer\n  inputs and disagree everywhere else — a bug that hides from every integer test case.\n\nDo not read any of this as a claim about Excel's internal algorithm. What the Handbook can say is\nthat this surface's accuracy is exactly the accuracy of whatever normal quantile sits underneath\nit, and that nobody has measured that here.\n\n\n",
    "quirks": "\n### Result and edge cases\n\n\nReturns `Number` — a positive half-width.\n\nDocumented boundary behaviour, from Microsoft's page:\n\n- Non-numeric argument → `#VALUE!`.\n- `alpha ≤ 0` or `alpha ≥ 1` → `#NUM!`. Both ends are closed against you: `alpha = 0` would be an\n  infinite interval and `alpha = 1` a degenerate one, and neither is admitted.\n- `standard_dev ≤ 0` → `#NUM!`. A zero spread is rejected rather than returning a zero width.\n- `size` non-integer → truncated; `size < 1` → `#NUM!`.\n\n\n### Errors\n\n\nAs documented on Microsoft's `CONFIDENCE.NORM` page:\n\n| Error | Condition |\n|---|---|\n| `#VALUE!` | Any argument is nonnumeric |\n| `#NUM!` | `alpha ≤ 0` or `alpha ≥ 1` |\n| `#NUM!` | `standard_dev ≤ 0` |\n| `#NUM!` | `size < 1` (after truncation) |\n\n",
    "sources": "- Abramowitz & Stegun, *Handbook of Mathematical Functions*, chapter 26 — the normal distribution\n  and its quantile approximations.\n- Wichura, \"Algorithm AS 241: The Percentage Points of the Normal Distribution\", *Applied\n  Statistics* 37 (1988) — the modern double-precision normal quantile.\n- Handbook call-model chapters [01 The value universe](../model/01-value-universe.md) and\n  [02 Coercion and lifting](../model/02-coercion-and-lifting.md).\n- Handbook projections `data/functions/FUNC.CONFIDENCE.NORM.json` (arity, classification, axes,\n  documented description) and `data/presence/FUNC.CONFIDENCE.NORM.json` (implementing module and\n  the twelve surfaces sharing it).\n\n\n",
    "version-differences": "No comparison between specific Excel builds is recorded here yet. This does not establish that all builds behave alike.",
    "what-it-does": "\n`CONFIDENCE.NORM(alpha, standard_dev, size)` returns the **half-width** of a two-sided confidence\ninterval for a population mean, under the assumption that the population standard deviation is\nknown and the sampling distribution of the mean is normal.\n\nWriting `Φ` for the standard normal cumulative distribution function and `z_q = Φ⁻¹(q)` for its\nquantile,\n\n    CONFIDENCE.NORM(α, σ, n)  =  z_{1 − α/2} · σ / √n\n\nand the interval Microsoft's page states is\n\n    x̄ ± CONFIDENCE.NORM(α, σ, n)\n\nwhere `x̄` is the sample mean. The confidence level is `100·(1 − α)%`, so `α = 0.05` gives the\nfamiliar 95% interval and `z_{0.975} ≈ 1.959963985…`.\n\nThree things follow from the formula and are worth stating plainly:\n\n1. **The function never sees your data.** It takes a spread and a count, not a sample. It is a\n   scaling of one normal quantile — the entire mathematical content is `Φ⁻¹`.\n2. **It returns a half-width, not an interval.** Readers who expect a pair of endpoints get a\n   single number; the endpoints have to be assembled by hand.\n3. **`σ` is treated as known.** That is the modelling assumption that separates this function from\n   [CONFIDENCE.T](FUNC.CONFIDENCE.T.md), which uses a Student's t quantile with `n − 1` degrees of\n   freedom because the spread was estimated from the sample.\n\nDomain and range. The mathematical function is defined for `α ∈ (0, 1)`, `σ > 0`, `n ≥ 1`, and is\npositive on all of it. It is decreasing in `α` (a higher confidence level widens the interval),\nlinear and increasing in `σ`, and decreasing in `n` like `n^(−1/2)` — the familiar square-root law\nthat makes halving an interval cost four times the sample. As `α → 0⁺` the value diverges, because\n`Φ⁻¹(q) → +∞` as `q → 1⁻`; as `α → 1⁻` it tends to `0`.\n\n\n\n### Arguments\n\n| Argument | Meaning (as documented) | Admissible values |\n|---|---|---|\n| `alpha` | \"The significance level used to compute the confidence level. The confidence level equals 100*(1 - alpha)%\" | `0 < alpha < 1`, per the documented error rule |\n| `standard_dev` | \"The population standard deviation for the data range and is assumed to be known\" | `standard_dev > 0`, per the documented error rule |\n| `size` | \"The sample size\" | `size ≥ 1` after truncation, per the documented error rule |\n\nThe commonly misunderstood position is the first. `alpha` is the significance level, **not** the\nconfidence level: a reader who wants 95% must pass `0.05`, and passing `0.95` silently produces the\n90%-two-tailed half-width instead of an error. Nothing in the value or the type catches that\nmistake.\n\nAll three are numeric slots subject to ordinary to-number coercion; see\n[Coercion and lifting](../model/02-coercion-and-lifting.md).\n\n\n"
  },
  "signature": {
    "display": "CONFIDENCE.NORM(alpha, standard_dev, size)",
    "parameters": [
      {
        "description": null,
        "name": "alpha",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "standard_dev",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "size",
        "optional": false,
        "repeats": false
      }
    ],
    "trailing_repeats": false
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "implemented",
        "reason": null
      },
      "arity": {
        "max": 3,
        "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": "RefOnly",
        "thread_safety_class": "SafePure",
        "volatility_class": "NonVolatile"
      },
      "descriptions": {
        "long": null,
        "short": "Half-width of a confidence interval for a mean, from the normal distribution",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Returns the confidence interval for a population mean",
        "microsoft_url": "https://support.microsoft.com/en-us/office/confidence-norm-function-7cec58a6-85bb-488d-91c3-63828d4fbfd4"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "CONFIDENCE.NORM"
        },
        {
          "locale": "bg-BG",
          "name": "CONFIDENCE.NORM"
        },
        {
          "locale": "cs-CZ",
          "name": "CONFIDENCE.NORM"
        },
        {
          "locale": "da-DK",
          "name": "KONFIDENS.NORM"
        },
        {
          "locale": "de-DE",
          "name": "CONFIDENCE.NORM"
        },
        {
          "locale": "el-GR",
          "name": "CONFIDENCE.NORM"
        },
        {
          "locale": "en-AU",
          "name": "CONFIDENCE.NORM"
        },
        {
          "locale": "en-GB",
          "name": "CONFIDENCE.NORM"
        },
        {
          "locale": "en-US",
          "name": "CONFIDENCE.NORM"
        },
        {
          "locale": "es-ES",
          "name": "INTERVALO.CONFIANZA.NORM"
        },
        {
          "locale": "et-EE",
          "name": "CONFIDENCE.NORM"
        },
        {
          "locale": "fi-FI",
          "name": "LUOTTAMUSVÄLI.NORM"
        },
        {
          "locale": "fr-FR",
          "name": "INTERVALLE.CONFIANCE.NORMAL*"
        },
        {
          "locale": "he-IL",
          "name": "CONFIDENCE.NORM"
        },
        {
          "locale": "hr-HR",
          "name": "CONFIDENCE.NORM"
        },
        {
          "locale": "hu-HU",
          "name": "MEGBÍZHATÓSÁG.NORM"
        },
        {
          "locale": "id-ID",
          "name": "CONFIDENCE.NORM"
        },
        {
          "locale": "it-IT",
          "name": "CONFIDENCE.NORM"
        },
        {
          "locale": "ja-JP",
          "name": "CONFIDENCE.NORM"
        },
        {
          "locale": "ko-KR",
          "name": "CONFIDENCE.NORM"
        },
        {
          "locale": "lt-LT",
          "name": "CONFIDENCE.NORM"
        },
        {
          "locale": "lv-LV",
          "name": "CONFIDENCE.NORM"
        },
        {
          "locale": "nb-NO",
          "name": "CONFIDENCE.NORM"
        },
        {
          "locale": "nl-NL",
          "name": "VERTROUWELIJKHEID.NORM"
        },
        {
          "locale": "pl-PL",
          "name": "UFNOŚĆ.NORM"
        },
        {
          "locale": "pt-BR",
          "name": "CONFIANÇA.NORMA"
        },
        {
          "locale": "pt-PT",
          "name": "INT.CONFIANÇA.NORM"
        },
        {
          "locale": "ro-RO",
          "name": "CONFIDENCE.NORM"
        },
        {
          "locale": "ru-RU",
          "name": "ДОВЕРИТ.НОРМ"
        },
        {
          "locale": "sk-SK",
          "name": "CONFIDENCE.NORM"
        },
        {
          "locale": "sl-SI",
          "name": "CONFIDENCE.NORM"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "CONFIDENCE.NORM"
        },
        {
          "locale": "sv-SE",
          "name": "KONFIDENCE.NORM"
        },
        {
          "locale": "th-TH",
          "name": "CONFIDENCE.NORM"
        },
        {
          "locale": "tr-TR",
          "name": "GÜVENİLİRLİK.NORM"
        },
        {
          "locale": "uk-UA",
          "name": "CONFIDENCE.NORM"
        },
        {
          "locale": "vi-VN",
          "name": "CONFIDENCE.NORM"
        },
        {
          "locale": "zh-CN",
          "name": "CONFIDENCE.NORM"
        },
        {
          "locale": "zh-HK",
          "name": "CONFIDENCE.NORM"
        },
        {
          "locale": "zh-TW",
          "name": "CONFIDENCE.NORM"
        }
      ],
      "signature": {
        "display": "CONFIDENCE.NORM(alpha, standard_dev, size)",
        "parameters": [
          {
            "description": null,
            "name": "alpha",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "standard_dev",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "size",
            "optional": false,
            "repeats": false
          }
        ],
        "trailing_repeats": false
      },
      "surface_name": "CONFIDENCE.NORM",
      "version_marker": null,
      "xlcall": {
        "code": "488",
        "symbol": "xlfConfidence_norm"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/confidence-norm-function-7cec58a6-85bb-488d-91c3-63828d4fbfd4"
  },
  "try_it": {
    "formula": "=CONFIDENCE.NORM(0.05, 1, 1)"
  },
  "url": "https://handbook.dnacalc.com/functions/CONFIDENCE.NORM.html",
  "variants": [],
  "versions": []
}