Compatibility
ZTEST
Close: 4 of 7 recorded answers differ in the last bits, worst 3 ULP
Everything else matches (7 workbook cells). Last-bit means a finite number within 16 ULP of Excel's. How we measure this · See the Rust code
Local names in 40 languages
| Language | Name in Excel |
|---|---|
| Arabic | ZTEST |
| Bulgarian | ZTEST |
| Czech | ZTEST |
| Danish | ZTEST |
| German | ZTEST |
| Greek | ZTEST |
| English (Australia) | ZTEST |
| English (United Kingdom) | ZTEST |
| English (United States) | ZTEST |
| Spanish | PRUEBA.Z |
| Estonian | ZTEST |
| Finnish | ZTESTI |
| French | TEST.Z |
| Hebrew | ZTEST |
| Croatian | ZTEST |
| Hungarian | Z.PRÓBA |
| Indonesian | ZTEST |
| Italian | ZTEST |
| Japanese | ZTEST |
| Korean | ZTEST |
| Lithuanian | ZTEST |
| Latvian | ZTEST |
| Norwegian | ZTEST |
| Dutch | Z.TOETS |
| Polish | TEST.Z |
| Portuguese (Brazil) | ZTEST |
| Portuguese (Portugal) | TESTEZ |
| Romanian | ZTEST |
| Russian | ZТЕСТ |
| Slovak | ZTEST |
| Slovenian | ZTEST |
| Serbian (Latin) | ZTEST |
| Swedish | ZTEST |
| Thai | ZTEST |
| Turkish | ZTEST |
| Ukrainian | ZTEST |
| Vietnamese | ZTEST |
| Chinese (Simplified) | ZTEST |
| Chinese (Hong Kong) | ZTEST |
| Chinese (Traditional) | ZTEST |
Names from Microsoft's support site.
What it does
ZTEST(array, x, [sigma])
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.
Try it
=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.
Quirks
The 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.
How to implement
Compute 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.
Rust code
Show the CalcFunc source of this function
Quoted from the public repository DnaCalc/DnaCalc, crates calc-func and calc-fml, at commit 9e1884369a67. Comments are the source's own. A kernel shared with other functions appears once, on its module page.
ZTEST · 1 lines · calc-func/src/catalogue/distributions.rs on GitHub107 ztest "ZTEST" (2, 3) [R "array", V "x", V "sigma"] |s, a, sv| { z_test_of(s, a, sv) }
Kernels shared with other functions
samplecatalogue/distributionsz_test_ofcatalogue/distributionsz_test_kernelported/confidence_test_familybinary_withported/excel_numericexcel_x87_addported/excel_numericexcel_x87_subported/excel_numericexcel_x87_mulported/excel_numericexcel_x87_divported/excel_numericexcel_sqrt_stagedported/excel_numericmulported/excel_numeric/x87addported/excel_numeric/x87subported/excel_numeric/x87divported/excel_numeric/x87stored_hornerported/normal_dist_commonerf_approxported/normal_dist_commonerfc_upperported/normal_dist_commonflush_subnormalported/normal_log_familyidentified_std_normal_cdfported/normal_log_familynorm_cdfported/normal_log_familynorm_s_dist_kernelported/normal_log_familyphi_kernelported/phi_fnerfc_kernelported/special_dist_familyerfc_precise_kernelported/special_dist_familyvariance_from_valuesported/variance_commonstdev_from_valuesported/variance_common
Argument and result plumbing
No implementation has been published with a Handbook test suite for this function.
Version differences
No 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.
Alternatives
Z.TEST is the modern spelling; T.TEST supplies a t-based comparison; NORM.S.DIST evaluates a normal CDF directly.
Named variants
No named variants are recorded yet.
Suggest a correction or contribute an implementation · For agents