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
LanguageName in Excel
ArabicZTEST
BulgarianZTEST
CzechZTEST
DanishZTEST
GermanZTEST
GreekZTEST
English (Australia)ZTEST
English (United Kingdom)ZTEST
English (United States)ZTEST
SpanishPRUEBA.Z
EstonianZTEST
FinnishZTESTI
FrenchTEST.Z
HebrewZTEST
CroatianZTEST
HungarianZ.PRÓBA
IndonesianZTEST
ItalianZTEST
JapaneseZTEST
KoreanZTEST
LithuanianZTEST
LatvianZTEST
NorwegianZTEST
DutchZ.TOETS
PolishTEST.Z
Portuguese (Brazil)ZTEST
Portuguese (Portugal)TESTEZ
RomanianZTEST
RussianZТЕСТ
SlovakZTEST
SlovenianZTEST
Serbian (Latin)ZTEST
SwedishZTEST
ThaiZTEST
TurkishZTEST
UkrainianZTEST
VietnameseZTEST
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

Input cells (optional)

Example: {"B2": 3, "B3": 4}. A1 holds the formula. Other cells need values before a formula can read them.

Enter a formula, then calculate.

Runs locally in your browser with OneCalc. Its answer may differ from Excel. Use English function names and commas between arguments.

=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 GitHub
107 ztest "ZTEST" (2, 3) [R "array", V "x", V "sigma"] |s, a, sv| { z_test_of(s, a, sv) }

Kernels shared with other functions

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