# Google Sheets CHISQ.TEST Function: Syntax, Examples & Tips

- URL: https://betteranalyst.com/google-sheets/chisqtest-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)

Returns the p-value of a chi-square test comparing observed counts with expected counts.

```
=CHISQ.TEST(observed_range, expected_range)
```

Generate FormulaExplain Formula

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

Describe the CHISQ.TEST you need in plain EnglishGenerate Formula

## Parameters

| Parameter | Required | Description |
| - | - | - |
| **observed\_range** | Yes | The observed counts. Can be a single row, a single column, or a table. |
| **expected\_range** | Yes | The expected counts under the null hypothesis. Must be the same size and shape as **observed\_range**. |

## What Is CHISQ.TEST?

CHISQ.TEST runs a Pearson chi-square test in a single formula. You supply the counts you observed and the counts you expected, and it returns the **p-value**: the probability of seeing differences at least this large if the null hypothesis were true. A small p-value (commonly below 0.05) suggests the observed pattern is unlikely to be due to chance alone.

CHISQ.TEST is the modern name for [CHITEST](https://betteranalyst.com/google-sheets/chitest-function); both behave the same way.

## How CHISQ.TEST Works

You give CHISQ.TEST two ranges of the same size:

- **observed\_range**: the counts you actually recorded
- **expected\_range**: the counts you would expect if the null hypothesis were true

CHISQ.TEST calculates the chi-square statistic, the sum of (observed − expected)² ÷ expected over every cell, and converts it to a right-tailed p-value. Degrees of freedom are worked out from the shape of the ranges:

- A single row or single column of *n* cells uses *n* − 1 degrees of freedom (goodness-of-fit).
- A table with *r* rows and *c* columns, where both are greater than 1, uses (*r* − 1) × (*c* − 1) (test of independence).

The result is the p-value only. CHISQ.TEST does not return the statistic itself.

## Basic Examples

### Goodness-of-fit

Observed counts of 30 and 20 in B2:B3, with expected counts of 25 and 25 in C2:C3:

```
=CHISQ.TEST(B2:B3, C2:C3)
```

The statistic is (5² ÷ 25) + (5² ÷ 25) = 2 with 1 degree of freedom, so the result is about 0.157. A 60/40 split in 50 trials is not strong evidence against an even split.

### Test of independence in a table

With observed counts in B2:D3 (2 rows × 3 columns), build the expected table in G2:I3 using row and column totals:

```
=SUM($B2:$D2) * SUM(B$2:B$3) / SUM($B$2:$D$3)
```

Fill that formula across G2:I3, then:

```
=CHISQ.TEST(B2:D3, G2:I3)
```

This returns the p-value with (2 − 1) × (3 − 1) = 2 degrees of freedom.

### Even distribution across categories

```
=CHISQ.TEST(B2:B8, ARRAYFORMULA(B2:B8*0 + SUM(B2:B8)/7))
```

Tests whether counts for the seven days of the week are spread evenly, generating the expected counts inline.

### Labelling the result

```
=IF(CHISQ.TEST(B2:D3, G2:I3) < 0.05, "Related", "No evidence of a relationship")
```

## Getting the Statistic Too

If you also want to report the chi-square statistic, calculate it alongside the p-value:

```
=SUMPRODUCT((B2:D3-G2:I3)^2/G2:I3)
```

Feed it to CHISQ.DIST.RT with the degrees of freedom and you will get the same p-value that CHISQ.TEST returns.

## Common Use Cases

- **A/B testing**: are conversion counts independent of the variant shown?
- **Survey analysis**: does preference differ by region, age group, or plan?
- **Quality**: are defects spread evenly across shifts or machines?
- **Marketing**: does channel mix differ between new and returning customers?

## Common Errors

- **#N/A or an error from mismatched ranges**: The observed and expected ranges must be the same size and shape.
- **Expected counts of zero**: Division by zero makes the test impossible. Combine sparse categories.
- **Passing percentages instead of counts**: Both ranges should be counts. Expected values in proportions understate the statistic.
- **Expected totals not matching**: Expected counts should add up to the same total as the observed counts.
- **Small samples**: When many expected counts are below about 5, the chi-square approximation is unreliable.

## Tips and Best Practices

- Build expected counts with formulas rather than typing them, so they update with the data.
- Report the p-value together with the statistic and degrees of freedom.
- A small p-value says the variables are related, not how strongly. Look at the table itself to see where the differences are.

## Related Functions

- [CHITEST](https://betteranalyst.com/google-sheets/chitest-function): legacy chi-square test
- [CHISQ.DIST.RT](https://betteranalyst.com/google-sheets/chisqdistrt-function): right-tailed probability (p-value)
- [CHISQ.INV.RT](https://betteranalyst.com/google-sheets/chisqinvrt-function): critical value from a right-tail probability
- [CHISQ.DIST](https://betteranalyst.com/google-sheets/chisqdist-function): left-tailed probability or density
- [IF](https://betteranalyst.com/google-sheets/if-function): turn a p-value into a decision

## Example use case

A product manager shows two onboarding flows to new users and records whether each user activated. With a 2×2 table of counts and an expected table built from row and column totals, =CHISQ.TEST(B2:C3, F2:G3) returns a p-value of 0.01, indicating activation depends on the flow.

## 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 Count Unique Values In Google Sheets](https://betteranalyst.com/google-sheets/how-to-count-unique-values-in-google-sheets)
- [How To Create A Pivot Table In Google Sheets](https://betteranalyst.com/google-sheets/how-to-create-a-pivot-table-in-google-sheets)
- [How To Divide In Google Sheets](https://betteranalyst.com/google-sheets/how-to-divide-in-google-sheets)
- [How To Enable Macros In Google Sheets](https://betteranalyst.com/google-sheets/how-to-enable-macros-in-google-sheets)
- [How To Filter In Google Sheets](https://betteranalyst.com/google-sheets/how-to-filter-in-google-sheets)
- [How To Find Circular References In Google Sheets](https://betteranalyst.com/google-sheets/how-to-find-circular-references-in-google-sheets)
- [How To Find Duplicates In Google Sheets](https://betteranalyst.com/google-sheets/how-to-find-duplicates-in-google-sheets)
- [How To Freeze A Row In Google Sheets](https://betteranalyst.com/google-sheets/how-to-freeze-a-row-in-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.
