CHITEST function
Runs a chi-squared test on observed and expected counts and returns the p-value. Replaced by CHISQ.TEST.
Available in All versions of Excel, including Microsoft 365 and Excel for the web (kept for compatibility)
In every Excel versionWorks in Google Sheets
Syntax
CHITEST(actual_range, expected_range)| Argument | What it means | |
|---|---|---|
actual_range | Required | The observed counts. |
expected_range | Required | The expected counts, same size and shape as actual_range. |
Returns: The p-value: the probability of differences at least this large if the observed counts really follow the expected ones.
How CHITEST works
CHITEST compares what you observed with what you expected and tells you whether the gap is likely to be chance. Typical uses: did customers choose the five weekdays equally? Is product preference independent of region? You supply two ranges of the same shape, and CHITEST computes the chi-squared statistic Σ(observed − expected)²/expected and returns its right-tail p-value.
You must calculate the expected counts yourself. For an independence test in a table, each expected cell is row total × column total ÷ grand total. The degrees of freedom are worked out from the shape: (rows − 1) × (columns − 1) for a table, or n − 1 for a single row or column. Expected counts below about 5 make the test unreliable.
Compatibility note: CHITEST is one of the older statistical functions that Excel 2010 moved to the Compatibility group. It still works in every version, but for new workbooks Microsoft recommends CHISQ.TEST. The arguments are identical, so rename it to CHISQ.TEST(actual_range, expected_range).
Examples
1Is the answer independent of the group?
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Yes | No | |||
| 2 | Group A | 58 | 35 | 0.000308 | |
| 3 | Group B | 11 | 25 | ||
| 4 | Group C | 10 | 23 | ||
| 5 | Expected A | 45.35 | 47.65 | ||
| 6 | Expected B | 17.56 | 18.44 | ||
| 7 | Expected C | 16.09 | 16.91 |
Result: 0.000308
The chi-squared statistic is about 16.17 with (3−1)×(2−1) = 2 degrees of freedom. The p-value of 0.000308 (formatted to 6 decimals) is far below 0.05, so the groups clearly answer differently.
2Are sales spread evenly over weekdays?
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Mon | Tue | Wed | Thu | Fri | |
| 2 | Orders | 52 | 38 | 41 | 49 | 70 |
| 3 | Expected | 50 | 50 | 50 | 50 | 50 |
| 4 | ||||||
| 5 | 0.0134 |
Result: 0.0134
250 orders spread evenly would give 50 a day. The statistic is 12.60 with 5−1 = 4 degrees of freedom, and the p-value 0.0134 (formatted to 4 decimals) is below 0.05: Friday's busier trade is unlikely to be chance.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#N/A | The two ranges have different shapes or sizes. | Make sure both ranges have the same number of rows and columns. |
#DIV/0! | An expected value is 0. | Expected counts must be positive. |
#NUM! | A value is negative, or the ranges have only one cell. | Check the data. |
Tips
- CHITEST returns only the p-value. To report the statistic as well, calculate
=SUMPRODUCT((B2:C4-B5:C7)^2/B5:C7). - Use counts, not percentages — percentages make the statistic meaningless.
Questions
Should I still use CHITEST?
Only if the workbook must open in Excel 2007 or earlier. Otherwise use CHISQ.TEST, which gives the same result and makes the intent clearer to the next person who reads the formula.
Will CHITEST stop working?
There is no announced removal date. Microsoft keeps compatibility functions so old workbooks keep calculating, but they get no new features.
Google Sheets
CHITEST also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.
CHITEST in other languages
In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.
| Language | Function name |
|---|---|
| Dutch | CHI.TOETS |
| Finnish | CHITESTI |
| French | TEST.KHIDEUX |
| Hungarian | KHI.PRÓBA |
| Italian | TEST.CHI |
| Norwegian (Bokmål) | KJI.TEST |
| Polish | TEST.CHI |
| Portuguese (Brazil) | TESTE.QUI |
| Portuguese (Portugal) | TESTE.CHI |
| Russian | ХИ2ТЕСТ |
| Spanish | PRUEBA.CHI |
| Swedish | CHI2TEST |
| Turkish | KİKARETEST |