ZTEST Function (Gnumeric)
Calculate an upper-tail sample-mean probability in Gnumeric with ZTEST, optional population standard deviation and one-sided interpretation.
Verification status: Gnumeric 1.12.57 ssconvert: specified ZTEST fixtures and separately captured worked-example GUI. Gnumeric 1.12.62 source inspected separately. How formula examples are checked
ZTEST returns the upper-tail probability associated with a sample mean under a hypothesized population mean. It is a one-sample normal-tail calculation. It does not return the z statistic itself, and it does not compare two ranges of observations.
Syntax and defaults
=ZTEST(ref,x[,stddev])
refis the required sample range or array.xis the required hypothesized population mean.stddevis an optional positive population standard deviation. If omitted, Gnumeric estimates it using the sample standard deviation, with the nā1 divisor.
The statistic is (sample_mean-x)/(stddev/SQRT(n)), and ZTEST returns the standard-normal probability above that statistic. With a sample mean above x, the returned probability is below 0.5; with a sample mean below x, it is above 0.5. When the means coincide and the standard error is positive, it is 0.5.
Numbers in the sample are collected while strings, logical values and blanks are ignored. Numeric zero counts. A referenced error propagates. Examples here use English names and commas as argument separators.
Worked example: known population spread
Enter 1, 2, 3, 4, 5 in A1:A5. The sample mean is 3 and n is 5. Suppose the null mean is 2 and the known population standard deviation is 2.
In C1 enter =ZTEST(A1:A5,2,2). The expected probability is approximately 0.131776239. The independent calculation uses z = ā5/2, approximately 1.118033989, and evaluates the standard-normal upper tail.
For comparison, enter =ZTEST(A1:A5,2) in C2. The sample standard deviation is ā2.5, so z becomes ā2. The expected result is approximately 0.078649604. Omitting the third argument materially changes the denominator; it is not a request to reuse the value 2 from C1.
The sample-estimated version still uses a normal distribution. It does not switch automatically to a t distribution. When the population spread is unknown, especially in small samples, choose a statistical method justified by the model rather than assuming omission supplies all necessary small-sample corrections.
Advanced use: a two-sided probability
For a two-sided normal test, use =2*MIN(C1,1-C1). The expected result for the known-spread example is approximately 0.263552477. Use both tails rather than simply multiplying C1 by two in every case: if the sample mean were below the null mean, C1 could exceed 0.5 and doubling it could exceed 1.
To inspect the statistic itself, =(AVERAGE(A1:A5)-2)/(2/SQRT(COUNT(A1:A5))) returns approximately 1.118033989. Keeping this value beside the p-value makes the direction visible. For a lower-tail alternative use =1-C1; for an upper-tail alternative use C1. Specify the alternative before examining the data.
Errors, sample size and edge cases
- With an omitted standard deviation, fewer than two numeric observations cannot supply the sample estimate and yields
#DIV/0!. - With an explicitly supplied positive standard deviation, the retained callback can calculate from one numeric observation. The help’s blanket statement that fewer than two observations always errors is broader than that implementation. This is an implementation distinction, not a claim that a one-observation study is generally adequate.
- Empty numeric input yields
#DIV/0!. A range full of numeric-looking text is still empty for this calculation. - Zero or negative supplied standard deviation yields
#DIV/0!in the examined implementation. Standard deviation is a positive scale, not a variance; do not pass a variance without taking its square root. - An omitted standard deviation with a constant sample has zero spread and yields
#DIV/0!. A valid externally known positive spread is a different model and must not be invented to remove the error. - A probability printed as 0.000 may simply be rounded. Increase precision before reporting the tail probability.
Version and verification scope
This guide distinguishes the retained Gnumeric 1.12.62 implementation from its help text where necessary. First introduction and last functioning release remain unverified. Numeric expectations above were independently computed using the normal distribution. Native evidence is identified separately below and does not establish all-version equivalence.
Related functions
Official sources
Native evidence note
On 17 October 2026, Gnumeric 1.12.57 recalculated a synthetic workbook through ssconvert in the C.UTF-8 locale. The 5 recorded ZTEST fixture cases matched the independently computed numerical results or the source-predicted error cases within floating-point precision. The cases covered supplied and omitted spread, a single numeric observation with supplied spread, and the omitted-spread and zero-spread errors. These records are engine tests; the separately captured worked-example screenshot is scoped below. It does not certify other versions, locales, workbook formats or untested edge cases.
Native application screenshot

Gnumeric 1.12.57, captured 17 October 2026. Sample A1:A5; mean=2; known SD=2. E2 omits SD. The selected cell E1 shows the formula in the formula bar. Display precision is shorter than the independent reference values; integer cells may show a trailing decimal point. GUI locale was not independently recorded.