{
  "category": "Compatibility",
  "display_name": "ZTEST",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.ZTEST",
  "implementation_state": {
    "answer_bank": null,
    "detail": "Everything else matches (7 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: 4 of 7 recorded answers differ in the last bits, worst 3 ULP",
    "workbook_corpus": {
      "cells": 7,
      "last_bit": 4,
      "matched": 3,
      "worst_ulp": 3
    }
  },
  "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#L349-L349"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/distributions::sample",
        "catalogue/distributions::z_test_of",
        "ported/confidence_test_family::z_test_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::excel_sqrt_staged",
        "ported/excel_numeric/x87::mul",
        "ported/excel_numeric/x87::add",
        "ported/excel_numeric/x87::sub",
        "ported/excel_numeric/x87::div",
        "ported/normal_dist_common::stored_horner",
        "ported/normal_dist_common::erf_approx",
        "ported/normal_dist_common::erfc_upper",
        "ported/normal_log_family::flush_subnormal",
        "ported/normal_log_family::identified_std_normal_cdf",
        "ported/normal_log_family::norm_cdf",
        "ported/normal_log_family::norm_s_dist_kernel",
        "ported/phi_fn::phi_kernel",
        "ported/special_dist_family::erfc_kernel",
        "ported/special_dist_family::erfc_precise_kernel",
        "ported/variance_common::variance_from_values",
        "ported/variance_common::stdev_from_values"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/distributions.rs#L349-L349",
      "state": "close",
      "suite": null,
      "summary": "Close: 4 of 7 recorded answers differ in the last bits, worst 3 ULP"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.ZTEST.json",
  "name": "ZTEST",
  "notes": [],
  "schema": "efh.function-reference/v1",
  "section_order": [
    "what-it-does",
    "try-it",
    "quirks",
    "how-to-implement",
    "version-differences",
    "alternatives"
  ],
  "sections": {
    "alternatives": "\n[Z.TEST](FUNC.Z.TEST.md) is the modern spelling; [T.TEST](FUNC.T.TEST.md) supplies a t-based comparison; [NORM.S.DIST](FUNC.NORM.S.DIST.md) evaluates a normal CDF directly.\n\n\n",
    "how-to-implement": "\nCompute the numeric count and mean. If sigma is omitted, obtain sample standard deviation from the recovered variance family. The recorded current combination is `z=(x-mean)*sqrt(n)/sigma`, then the standard-normal **left CDF** at z. Do not rewrite it as a right-tail subtraction on `(mean-x)/(sigma/sqrt(n))`: mathematically equivalent forms have different stored results. The equal-mean example gives z=0 and probability one half. Inner normal tails still depend on the open ERFC factor.\n\n\n",
    "quirks": "\nThe public page documents `#N/A` for an empty array. The current helper has its own empty/nonfinite validation, so retain that error distinction in comparisons. A supplied scale must be positive, and an omitted scale needs enough sample data. A two-tailed test uses `2*MIN(p,1-p)` under the stated worksheet composition, not simply `2*p` in every case.\n\n\n",
    "sources": "\n- [Microsoft: ZTEST function](https://support.microsoft.com/en-us/excel/functions/ztest-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/confidence_test_family.rs); implementation steps and the limits identified in the text.\n\n",
    "try-it": "\n`=ZTEST({1,2,3},2,1)` returns `0.5`: the sample mean equals the hypothesis. If the sample mean exceeds x, this one-tail result is below one half.\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`ZTEST(array,x,[sigma])` returns a one-tailed normal-test probability for a hypothesised population mean x. Supply a known population standard deviation sigma, or let the function use sample standard deviation. This is the compatibility name.\n\n\n"
  },
  "signature": {
    "display": "ZTEST(array, x, [sigma])",
    "parameters": [
      {
        "description": null,
        "name": "array",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "x",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "sigma",
        "optional": true,
        "repeats": false
      }
    ],
    "trailing_repeats": false
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "implemented",
        "reason": null
      },
      "arity": {
        "max": 3,
        "min": 2
      },
      "category": "Compatibility",
      "classification": {
        "arg_preparation_profile": "RefsVisibleInAdapter",
        "coercion_lift_profile": "Custom",
        "determinism_class": "Deterministic",
        "error_collapse_profile": "None",
        "fec_dependency_profile": "RefOnly",
        "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": "One-tailed z-test probability (older form of Z.TEST)",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Returns the one-tailed probability-value of a z-test",
        "microsoft_url": "https://support.microsoft.com/en-us/office/ztest-function-8f33be8a-6bd6-4ecc-8e3a-d9a4420c4a6a"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "ZTEST"
        },
        {
          "locale": "bg-BG",
          "name": "ZTEST"
        },
        {
          "locale": "cs-CZ",
          "name": "ZTEST"
        },
        {
          "locale": "da-DK",
          "name": "ZTEST"
        },
        {
          "locale": "de-DE",
          "name": "ZTEST"
        },
        {
          "locale": "el-GR",
          "name": "ZTEST"
        },
        {
          "locale": "en-AU",
          "name": "ZTEST"
        },
        {
          "locale": "en-GB",
          "name": "ZTEST"
        },
        {
          "locale": "en-US",
          "name": "ZTEST"
        },
        {
          "locale": "es-ES",
          "name": "PRUEBA.Z"
        },
        {
          "locale": "et-EE",
          "name": "ZTEST"
        },
        {
          "locale": "fi-FI",
          "name": "ZTESTI"
        },
        {
          "locale": "fr-FR",
          "name": "TEST.Z*"
        },
        {
          "locale": "he-IL",
          "name": "ZTEST"
        },
        {
          "locale": "hr-HR",
          "name": "ZTEST"
        },
        {
          "locale": "hu-HU",
          "name": "Z.PRÓBA"
        },
        {
          "locale": "id-ID",
          "name": "ZTEST"
        },
        {
          "locale": "it-IT",
          "name": "ZTEST"
        },
        {
          "locale": "ja-JP",
          "name": "ZTEST"
        },
        {
          "locale": "ko-KR",
          "name": "ZTEST"
        },
        {
          "locale": "lt-LT",
          "name": "ZTEST"
        },
        {
          "locale": "lv-LV",
          "name": "ZTEST"
        },
        {
          "locale": "nb-NO",
          "name": "ZTEST"
        },
        {
          "locale": "nl-NL",
          "name": "Z.TOETS"
        },
        {
          "locale": "pl-PL",
          "name": "TEST.Z"
        },
        {
          "locale": "pt-BR",
          "name": "ZTEST"
        },
        {
          "locale": "pt-PT",
          "name": "TESTEZ"
        },
        {
          "locale": "ro-RO",
          "name": "ZTEST"
        },
        {
          "locale": "ru-RU",
          "name": "ZТЕСТ"
        },
        {
          "locale": "sk-SK",
          "name": "ZTEST"
        },
        {
          "locale": "sl-SI",
          "name": "ZTEST"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "ZTEST"
        },
        {
          "locale": "sv-SE",
          "name": "ZTEST"
        },
        {
          "locale": "th-TH",
          "name": "ZTEST"
        },
        {
          "locale": "tr-TR",
          "name": "ZTEST"
        },
        {
          "locale": "uk-UA",
          "name": "ZTEST"
        },
        {
          "locale": "vi-VN",
          "name": "ZTEST"
        },
        {
          "locale": "zh-CN",
          "name": "ZTEST"
        },
        {
          "locale": "zh-HK",
          "name": "ZTEST"
        },
        {
          "locale": "zh-TW",
          "name": "ZTEST"
        }
      ],
      "signature": {
        "display": "ZTEST(array, x, [sigma])",
        "parameters": [
          {
            "description": null,
            "name": "array",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "x",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "sigma",
            "optional": true,
            "repeats": false
          }
        ],
        "trailing_repeats": false
      },
      "surface_name": "ZTEST",
      "version_marker": null,
      "xlcall": {
        "code": "324",
        "symbol": "xlfZtest"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/ztest-function-8f33be8a-6bd6-4ecc-8e3a-d9a4420c4a6a"
  },
  "try_it": {
    "formula": "=ZTEST({1,2,3},2,1)"
  },
  "url": "https://handbook.dnacalc.com/functions/ZTEST.html",
  "variants": [],
  "versions": []
}