=CHISQ.TEST(observed_range, expected_range)One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.
| 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. |
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; both behave the same way.
You give CHISQ.TEST two ranges of the same size:
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:
The result is the p-value only. CHISQ.TEST does not return the statistic itself.
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.
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.
=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.
=IF(CHISQ.TEST(B2:D3, G2:I3) < 0.05, "Related", "No evidence of a relationship")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.
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.
Sign up for Better Analyst and get unlimited AI-powered formula generation, explanations, and advanced data analysis.
Browse our complete library of Google Sheets formula guides
Compare your options
Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.
AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.