Compatibility
Excel 2007 (Compatibility)
◉ 30 views
=ZTEST()
Returns the one-tailed probability-value of a z-test. For a given hypothesized population mean, μ0, ZTEST returns the probability that the sample mean would be greater than the average of observations in the data set (array) — that is, the observed sample mean.
Applies To:
Excel for Microsoft 365Excel for Microsoft 365 for MacExcel 2024Excel 2024 for MacExcel 2021Excel 2021 for MacExcel 2019Excel 2016
=ZTEST(array,x,[sigma])
Hover argument names in the table for details.
Output typeNumber
Popularity10 / 100
VolatileNo
Dynamic ArrayNo
Download sample .xlsx ▦ Try in Playground
Dedicated file for this function — safe & lightweight · sample data + live formulas
⬇ Download Sample Workbook
A dedicated .xlsx for =ZTEST() with Persian sample data & live formulas — open in Excel and practice.
- Sheet “Sample” — data table + formula in place
- Sheet “Guide” — syntax, arguments & tips from this page
- Instant & secure (token + rate limit)
Quiz this function
%d questions — syntax, example & errors — test yourself!
◧ Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
array |
Range | Required | The array or range of data against which to test x. |
x |
Number | Required | The value to test. |
sigma |
Number | Optional | The population (known) standard deviation. If omitted, the sample standard deviation is used. |
▣ Examples
▦ Data
| Cell | Value |
|---|---|
A2 |
3 |
A3 |
6 |
A4 |
7 |
A5 |
8 |
A6 |
6 |
A7 |
5 |
A8 |
4 |
A9 |
2 |
A10 |
1 |
A11 |
9 |
A12 |
3 |
A13 |
6 |
A14 |
7 |
A15 |
8 |
A16 |
6 |
A17 |
5 |
A18 |
4 |
A19 |
2 |
A20 |
1 |
A21 |
9 |
One-tailed probability-value of a z-test for the data set above, at the hypothesized population mean of 4 (0.090574)
=ZTEST(A2:A11,4)
Result:
0.090574
Two-tailed probability-value of a z-test for the data set above, at the hypothesized population mean of 4 (0.181148)
=2 * MIN(ZTEST(A2:A11,4), 1 - ZTEST(A2:A11,4))
Result:
0.181148
One-tailed probability-value of a z-test for the data set above, at the hypothesized population mean of 6 (0.863043)
=ZTEST(A2:A11,6)
Result:
0.863043
Two-tailed probability-value of a z-test for the data set above, at the hypothesized population mean of 6 (0.273913)
=2 * MIN(ZTEST(A2:A11,6), 1 - ZTEST(A2:A11,6))
Result:
0.273913
§ Remarks
- If array is empty, ZTEST returns the #N/A error value.
- ZTEST is calculated as follows when sigma is not omitted: or when sigma is omitted: where x is the sample mean AVERAGE(array); s is the sample standard deviation STDEV(array); and n is the number of observations in the sample COUNT(array).
- ZTEST represents the probability that the sample mean would be greater than the observed value AVERAGE(array), when the underlying population mean is μ0. From the symmetry of the Normal distribution, if AVERAGE(array) < μ0, ZTEST will return a value greater than 0.5.
- The following Excel formula can be used to calculate the two-tailed probability that the sample mean would be further from μ0 (in either direction) than AVERAGE(array), when the underlying population mean is μ0: =2 * MIN(ZTEST(array,μ0,sigma), 1 - ZTEST(array,μ0,sigma)).
✦ Tips
- This function has been replaced with one or more new functions that may provide improved accuracy and whose names better reflect their usage. Although this function is still available for backward compatibility, you should consider using the new functions from now on, because this function may not be available in future versions of Excel.
- ZTEST represents the probability that the sample mean would be greater than the observed value AVERAGE(array), when the underlying population mean is μ0. From the symmetry of the Normal distribution, if AVERAGE(array) < μ0, ZTEST will return a value greater than 0.5.
- The following Excel formula can be used to calculate the two-tailed probability that the sample mean would be further from μ0 (in either direction) than AVERAGE(array), when the underlying population mean is μ0: =2 * MIN(ZTEST(array,μ0,sigma), 1 - ZTEST(array,μ0,sigma)).
⚠ Common Errors
#N/A
If array is empty, ZTEST returns the #N/A error value.
Fix: Enter a data range
💬 Comments & Q&A 0 approved
🔒 Your comment will be published after review.Share your thoughts — visible after admin approval
No comments yet — be the first!