Contact

Z.TEST in ONLYOFFICE Spreadsheet Editor

Statistical Intermediate ONLYOFFICE Spreadsheet Editor

Calculate a one-sided normal-tail test result with supplied or sample-estimated sigma, explicit tail direction and source-specific handling of errors and small samples.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: For observations 2,4,6,8, hypothesized mean 4 and supplied population standard deviation 2, =Z.TEST(A1:A4,4,2) independently returns 0.158655253931, the upper normal tail at z=1.

Availability and evidence scope

  • Introduced: Original introduction release is not established by the checked sources.
  • Available: Listed in current unversioned ONLYOFFICE help, checked October 18, 2026.
  • Implementation inspected: Official SDKJS v10.0.0.169, commit 3679e0375a758d7dc59d31337a45461be3525ed8. The snapshot does not prove identical behavior in every installed editor.
  • Retired or deprecated: These sources do not establish retirement or formal deprecation.
  • Testing: Numerical examples are independent mathematical expectations, and implementation discrepancies are labeled source predictions. No ONLYOFFICE application or calculation-engine execution was performed.

The examples use English function names and commas. Use your locale’s argument separator if different. Retain full precision in formulas; round only the displayed result. These examples establish only the stated mathematical or source-trace cases. Application rendering, array placement and general import/export behavior have not been tested.

Syntax and tail direction

=Z.TEST(array, x, [sigma])
=ZTEST(array, x, [sigma])

Two or three arguments are registered. array supplies numeric observations, x is the hypothesized population mean, and optional sigma is a positive population standard deviation, not a variance. If sigma is omitted, the implementation estimates a sample variance and uses its square root in the standard error.

The function computes the upper normal tail at z=(sample_mean-x)/(sigma/SQRT(n)). A sample mean greater than x gives a positive z and an upper-tail result below 0.5. A sample mean below x gives a negative z and a result above 0.5. This direction is important: the result is not automatically a two-sided p-value.

Z.TEST inherits the ZTEST calculation in the inspected source. The names share this calculation path, but that does not prove every coercion, array or file-import detail behaves identically in every installed version.

Step-by-step: a known-sigma example

  1. Enter 2,4,6,8 in A1:A4.
  2. Enter hypothesized mean 4 in C1 and population sigma 2 in C2.
  3. Enter =Z.TEST(A1:A4,C1,C2) in D1.
  4. The independent expectation is 0.158655253931.

The sample mean is 5 and n=4. Standard error is 2/SQRT(4)=1, so z=(5−4)/1=1. The standard-normal area above 1 is approximately 0.158655253931. Independent arithmetic used the complementary error function, rather than executing the ONLYOFFICE engine.

Hypothesized mean x z with supplied sigma=2 Independent upper-tail result
4 1 0.158655253931
5 0 0.5
6 -1 0.841344746069

The last row is not a stronger upper-tail rejection merely because its number is large. It indicates that the sample mean lies below the hypothesized mean, opposite the upper-tail direction.

Omitting sigma changes the standard error

=Z.TEST(A1:A4,4) estimates the sample variance as (sum(y²)-sum(y)²/n)/(n-1). For the dataset, the variance is 20/3 and sample standard deviation is about 2.581988897472. Standard error is sqrt(5/3), so z=sqrt(3/5)≈0.774596669241. The independent upper-tail expectation is 0.219289013040.

The omitted-sigma branch still evaluates a normal tail. It does not switch to a Student t distribution merely because the standard deviation was estimated from the sample. For a small sample with unknown population variance, choosing the appropriate test model is a separate statistical decision. The function’s arithmetic alone does not establish that a normal approximation is suitable.

Advanced example: derive the requested tail explicitly

Let p be the upper-tail result from Z.TEST. A lower-tail result for the same statistic is 1-p. A symmetric two-sided normal-tail result is 2*MIN(p,1-p). For the known-sigma example at x=4, that two-sided value is 0.317310507863.

Choose the alternative hypothesis and tail before examining the result. Doubling p blindly is wrong when p>0.5; the smaller tail is needed for the symmetric two-sided expression. The displayed probability is not the probability that the null hypothesis is true, nor an effect size or a guarantee that another sample will behave similarly.

Keep sigma’s units equal to the observations’ units. Supplying a variance of 4 where standard deviation 2 was intended doubles the standard error and changes the test. Likewise, changing the data’s scale requires changing both the hypothesized mean and supplied sigma consistently.

Data selection and error behavior

The inspected data loop includes only numeric matrix elements and skips other element types, including error cells. For a range containing numeric 2, numeric 4 and a cell with =1/0, =Z.TEST(A1:A3,3,1) is source-predicted to use the two numbers and return 0.5. That behavior differs from many aggregators that propagate an embedded error. It can conceal missing or broken observations, so clean and count the intended sample explicitly.

The function requires more than one numeric observation even when a positive sigma is supplied. =Z.TEST(2,2,1) predicts internal division_by_zero, conventionally #DIV/0!. Supplied sigma<=0 predicts not_numeric (#NUM!). Existing top-level errors or conversion failures may propagate before the matrix loop; that is different from an error embedded within a data range.

With sigma omitted and constant observations, the estimated sample variance is zero. The subsequent zero-standard-error calculation can produce nonfinite intermediate values, so do not assume a valid p-value or a universal error display from generic spreadsheet advice. Use a justified positive population sigma when that is genuinely known; do not add an arbitrary number just to avoid an error.

The source computes 0.5-gauss(z), which can lose relative precision in extreme upper tails. Small reported or rounded-zero values should be validated separately. Independence, representative sampling and a suitable distributional model remain assumptions outside the function’s checks.

Recalculate representative formulas when moving a workbook between editors. Matching names do not guarantee identical argument coercion, array behavior, numerical precision or error handling. These source-derived examples do not establish automatic spill behavior or a general import/export guarantee.

Official references