Compatibility function

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

Older function. CHITEST still works, but for new workbooks use CHISQ.TEST.

Syntax

CHITEST(actual_range, expected_range)
ArgumentWhat it means
actual_rangeRequiredThe observed counts.
expected_rangeRequiredThe 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?

E2fx=CHITEST(B2:C4, B5:C7)
ABCDE
1YesNo
2Group A58350.000308
3Group B1125
4Group C1023
5Expected A45.3547.65
6Expected B17.5618.44
7Expected C16.0916.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?

B5fx=CHITEST(B2:F2, B3:F3)
ABCDEF
1MonTueWedThuFri
2Orders5238414970
3Expected5050505050
4
50.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.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 14 KB

Common errors and how to fix them

ErrorWhy it happensFix
#N/AThe 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.

LanguageFunction name
DutchCHI.TOETS
FinnishCHITESTI
FrenchTEST.KHIDEUX
HungarianKHI.PRÓBA
ItalianTEST.CHI
Norwegian (Bokmål)KJI.TEST
PolishTEST.CHI
Portuguese (Brazil)TESTE.QUI
Portuguese (Portugal)TESTE.CHI
RussianХИ2ТЕСТ
SpanishPRUEBA.CHI
SwedishCHI2TEST
TurkishKİKARETEST