# Google Sheets ZTEST Function: Syntax, Examples & Tips

- URL: https://betteranalyst.com/google-sheets/ztest-function
- Author: Better Analyst

Formula Bot is now Better Analyst—same account, more powerful analysis.Formula Bot is now Better Analyst—same account and workflows, with more powerful analysis, dashboards, and automation.

[Learn what changed](https://betteranalyst.com/formula-bot-is-now-better-analyst)

The ZTEST function calculates the z-score for a sample mean, comparing it to a population mean, useful for hypothesis testing.

```
ZTEST(data, value, [standard_deviation])
```

Generate FormulaExplain Formula

One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.

Describe the ZTEST you need in plain EnglishGenerate Formula

## Parameters

**`data`**:\
The range of cells containing the sample data for which you want to perform the Z-test.

**`value`**:\
The hypothesized population mean that you want to test against the sample data.

**`standard_deviation`**:\
(Optional) The standard deviation of the population. If omitted, the standard deviation is calculated from the sample data.

## What is a ZTEST?

The *ZTEST* function in Google Sheets is a statistical tool used to determine whether the mean of a sample is significantly different from a known population mean. It performs a one-sample Z-test, which is particularly useful when the population standard deviation is known and the sample size is large (typically n > 30). This function helps in hypothesis testing by providing a Z-score that indicates how many standard deviations the sample mean is from the population mean.

In simpler terms, ZTEST allows you to assess if the average of your sample data significantly deviates from a known average, helping you make informed decisions based on statistical evidence.

## A Practical Example

Imagine you are analyzing the test scores of students in a class and want to see if their average score is significantly different from the national average score:

### Sample Data:

| StudentID | TestScore |
| - | - |
| 1 | 85 |
| 2 | 90 |
| 3 | 78 |
| 4 | 88 |
| 5 | 92 |

### Known Population Mean:

- National Average Test Score: 80

## ZTEST Formula

To determine if the average test score of your sample is significantly different from the national average, you would use the ZTEST function as follows:

```
=ZTEST(A2:A6, 80, STDEV(A2:A6), COUNT(A2:A6))
```

In this formula:

- `A2:A6` is the range containing the TestScores of the sample.
- `80` is the known population mean (national average).
- `STDEV(A2:A6)` calculates the standard deviation of the sample scores.
- `COUNT(A2:A6)` counts the number of scores in the sample.

## Result of the Formula

When you apply the ZTEST formula to the sample data, it will return a Z-score that indicates how many standard deviations the sample mean is from the population mean. A Z-score greater than 1.96 or less than -1.96 typically indicates a statistically significant difference at the 0.05 significance level.

## Why Use ZTEST?

ZTEST is beneficial because it provides a straightforward way to conduct hypothesis testing when you have a large sample size and know the population standard deviation. It helps in making data-driven decisions by allowing you to assess the significance of your findings. Additionally, it is a key component in various fields such as education, healthcare, and market research where statistical analysis is crucial.

## Key Takeaways:

- **ZTEST**: A statistical function that tests if a sample mean is significantly different from a known population mean.
- **Large Sample Size**: Best used when the sample size is large (n > 30) and the population standard deviation is known.
- **Hypothesis Testing**: A valuable tool for making informed decisions based on statistical evidence.
- **Common Use Cases**: Ideal for educational assessments, quality control, and any scenario where comparing sample means to population means is necessary.

ZTEST is an essential function for anyone working with data analysis in Google Sheets, providing a powerful way to enhance statistical evaluation and reporting capabilities.

Happy analyzing!

## Example use case

You have a dataset of test scores in Column A and their corresponding grades in Column B. You can use ZTEST to determine if the average score of a new sample significantly differs from the established average, aiding in performance analysis.

## Need more help with Google Sheets formulas?

Sign up for Better Analyst and get unlimited AI-powered formula generation, explanations, and advanced data analysis.

[Create Free Account](https://betteranalyst.com/signup)[Try Formula Generator](https://betteranalyst.com/excel-ai)

## Google Sheets how-to guides

- [How To Sort In Google Sheets](https://betteranalyst.com/google-sheets/how-to-sort-in-google-sheets)
- [How To Split Cells In Google Sheets](https://betteranalyst.com/google-sheets/how-to-split-cells-in-google-sheets)
- [How To Strikethrough In Google Sheets](https://betteranalyst.com/google-sheets/how-to-strikethrough-in-google-sheets)
- [How To Subtract In Google Sheets](https://betteranalyst.com/google-sheets/how-to-subtract-in-google-sheets)
- [How To Transpose Data In Google Sheets](https://betteranalyst.com/google-sheets/how-to-transpose-data-in-google-sheets)
- [How To Unhide Columns In Google Sheets](https://betteranalyst.com/google-sheets/how-to-unhide-all-columns-in-google-sheets)
- [How To Unhide Rows In Google Sheets](https://betteranalyst.com/google-sheets/how-to-unhide-all-rows-in-google-sheets)
- [How To Unprotect Google Sheets](https://betteranalyst.com/google-sheets/how-to-unprotect-google-sheets)

## Explore all Google Sheets formulas

Browse our complete library of Google Sheets formula guides

Compare your options

## Decide with evidence, not a sales pitch.

Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.

1. [01ChatGPTOpen a balanced comparison prompt in ChatGPT.](https://chatgpt.com/?prompt=Compare%20Better%20Analyst%20with%20using%20a%20general-purpose%20AI%20assistant%20for%20data%20analysis.%20Evaluate%20spreadsheet%20and%20document%20analysis%2C%20dashboards%2C%20repeatable%20reports%2C%20code%20transparency%2C%20data%20connections%2C%20pricing%2C%20and%20limitations.%20Use%20current%20public%20sources%2C%20distinguish%20verified%20facts%20from%20assumptions%2C%20and%20explain%20which%20types%20of%20users%20each%20option%20fits%20best.)
2. [02ClaudeOpen the same research prompt in Claude.](https://claude.ai/new?q=Compare%20Better%20Analyst%20with%20using%20a%20general-purpose%20AI%20assistant%20for%20data%20analysis.%20Evaluate%20spreadsheet%20and%20document%20analysis%2C%20dashboards%2C%20repeatable%20reports%2C%20code%20transparency%2C%20data%20connections%2C%20pricing%2C%20and%20limitations.%20Use%20current%20public%20sources%2C%20distinguish%20verified%20facts%20from%20assumptions%2C%20and%20explain%20which%20types%20of%20users%20each%20option%20fits%20best.)
3. [03PerplexityResearch the comparison with linked web sources.](https://www.perplexity.ai/search?q=Compare%20Better%20Analyst%20with%20using%20a%20general-purpose%20AI%20assistant%20for%20data%20analysis.%20Evaluate%20spreadsheet%20and%20document%20analysis%2C%20dashboards%2C%20repeatable%20reports%2C%20code%20transparency%2C%20data%20connections%2C%20pricing%2C%20and%20limitations.%20Use%20current%20public%20sources%2C%20distinguish%20verified%20facts%20from%20assumptions%2C%20and%20explain%20which%20types%20of%20users%20each%20option%20fits%20best.)

AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.
