Contact

CHITEST in WPS Spreadsheet: Compare Observed and Expected Counts

Statistical Intermediate WPS Spreadsheet

Calculate a chi-square test probability from observed and expected count ranges, with independently checked examples and WPS source limits.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: =CHITEST(A2:B3,D2:E3) compares the observed counts in A2:B3 with the corresponding expected counts in D2:E3. Its result is a chi-square test probability, not the chi-square statistic itself.

Availability and evidence

The WPS lesson identifies WPS Office for Windows Personal. Its final demonstration shows a small probability from complete observed and expected tables. That distinguishes the result from the much larger chi-square statistic calculated from those tables. The prose alone is imprecise about this distinction.

The WPS Open Platform ChiTest documentation separately describes the upper-tail probability and degrees of freedom. It documents the JavaScript WorksheetFunction method; it does not establish availability in every desktop edition. These sources were reviewed October 19, 2026. Exact first/last supported builds, global-English, Mac, Linux, web and mobile behavior remain unverified. The examples below are mathematical controls, not results from a new WPS test.

Syntax

=CHITEST(actual_range,expected_range)
  • actual_range: the observed counts arranged by category.
  • expected_range: corresponding expected counts, with the same row and column arrangement.

Pass the ranges, not their grand totals. Matching positions must refer to the same category. In an independence test, construct expected counts from each row total multiplied by each column total and divided by the grand total. Do not round those expected counts before the test.

Example: survey response and group

Enter these observations:

Cell Entry Meaning
A2 30 Group 1, response Yes
B2 20 Group 1, response No
A3 10 Group 2, response Yes
B3 40 Group 2, response No

Both row totals are 50. Column totals are 40 and 60, and the grand total is 100. The expected counts under independence are therefore:

Cell Entry
D2 20
E2 30
D3 20
E3 30

In G2 enter:

=CHITEST(A2:B3,D2:E3)

Independent expected result: approximately 0.0000445570906041. Use a number format with enough decimal places; a display of 0.00 would hide the useful result.

The independent check adds (observed-expected)^2/expected across the four cells, giving a statistic of 16.6666666667. With one degree of freedom, the upper-tail probability is about 0.0000445571. The statistic and the probability answer different questions and should not share a worksheet label.

Control: exact agreement

If A2:B3 instead contains 20, 30 in the first row and 20, 30 in the second, keep the expected table unchanged. The statistic becomes zero and the independent expected probability is 1. This is a useful formula-reference check, not proof that the underlying population model is correct.

Interpretation and troubleshooting

A small p-value indicates that the observed discrepancy would be unusual under the test’s assumptions. It is not the probability that the hypothesis is true, and it does not measure the practical size or cause of an association. Select any decision threshold before inspecting the result and consider whether the sampling design makes the test appropriate.

  • Exclude category labels and totals from both input ranges.
  • Preserve the category order in both tables; a misplaced row changes the question being tested.
  • Use positive expected counts. For sparse categories, obtain suitable statistical advice rather than treating a spreadsheet result as sufficient evidence.
  • Do not use two isolated grand totals as a replacement for a contingency table.
  • The API documentation reports an error for unequal data-point counts and disallows a one-cell-versus-one-cell test. Exact desktop error behavior was not independently exercised here.

The official lesson’s example is valuable as output evidence, but its displayed expected counts are not the marginal-total-derived expected table for its observations. This guide uses a new internally consistent survey fixture instead of adopting that lesson’s hypothesis design.

Use CHITEST for aligned observed and expected count tables. A comparison of two samples’ numerical variances is a different question; FTEST is intended for that task. Do not change function names merely to make an unexpected result smaller.

For a supplied chi-square statistic rather than two count tables, see CHIDIST right-tail probability. CHISQ.DIST covers left-tail probability and density; keep that tail distinction explicit when checking a CHITEST result.