Contact

CHITEST in Apple Numbers: Chi-Square Tests with Observed and Expected Counts

Statistical Advanced Apple Numbers

Learn Apple Numbers CHITEST syntax with a reproducible contingency table, calculated expected counts, p-values and interpretation.

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

Quick answer. =CHITEST(B2:C4,E2:F4) compares the observed count table B2:C4 with an equally shaped expected count table E2:F4. For the complete 3-by-2 example below, independent chi-square computation gives 0.043546385685296, a right-tail p-value. This number is a probability under a chosen null model, not a count, a chi-square statistic, or a statement that the null hypothesis has a 4.35% probability of being true. No formula was executed in Numbers. [A1, C1]

Availability and version history

  • Introduced: Documented in Apple’s Formulas and Functions Help 15.4; the original introduction release is not established.
  • Availability: Currently documented for Numbers in that help version; it is not a final supported-version endpoint.
  • Scope: Shared iWork function help. Availability in individual clients and older releases is not established by this check.
  • Checked: October 14, 2026, against the official CHITEST reference. Documentation check; not a new native test.

What CHITEST is for (and what it is not)

CHITEST is Apple’s documented function for obtaining a value from the chi-square distribution for observed-versus-expected frequency tables. A practical use is asking whether the distribution of response categories appears independent of a group label, provided the expected counts and sampling model are appropriate. Apple’s help states that CHITEST uses number values in two collection arguments and that its reported degrees of freedom are the number of rows of actual values minus one. For the 3-row, 2-column illustration below, that agrees with the conventional independence-test degrees of freedom (3 − 1) × (2 − 1) = 2. Do not generalize Apple’s rows-only degrees-of-freedom statement to arbitrary multi-column tests without confirming the desired statistical model. [A1, C1]

The mathematical reference calculation uses the familiar Pearson statistic:

chi-square = SUM over all matching cells ((observed - expected)^2 / expected)
p-value    = right-tail chi-square probability for the designated degrees of freedom

This is independent statistical interpretation, not evidence that Numbers has a separate CHI2.TEST alias or any particular undocumented numeric coercion. [C1]

Exact Apple syntax and ordered arguments

=CHITEST(actual-values, expected-values)
Position Official argument Type and meaning Required? Default
1 actual-values Collection/range of numbers representing observed counts Yes None
2 expected-values Collection/range of numbers representing the corresponding expected counts in the same row/column layout Yes None

Both arguments are mandatory. The official help does not document an optional tails selector, an optional degrees-of-freedom parameter, or a built-in switch to generate expected counts for you. In particular, =CHITEST(B2:C4) is incomplete. Apple describes numbers, not text or booleans, as valid cell values here. [A1]

In English-locale function documentation, arguments are comma-separated. Numbers may display a different separator in a locale using a decimal comma; use the local formula editor rather than copying English punctuation blindly. A range like B2:C4 is relative to the current Numbers table. When the data live in another table, use its table-qualified range reference, e.g. Responses::B2:C4. Apple’s cell-reference help—not Excel worksheet notation—is the reference for qualified table names, fill behaviour and $ anchors. [A2, A3]

Reproducible example: build a proper 3 × 2 test in Numbers

Create a single Numbers table named Responses with enough columns (through F) and rows (through 6). Leave header names flexible, but put the exact following count values in these cells. The entries are integers representing mutually exclusive response categories by group. [C1]

Row B: Group 1 observed C: Group 2 observed D: Row total E: Group 1 expected F: Group 2 expected
2 30 20 =SUM(B2:C2) → 50 26.9230769231 23.0769230769
3 15 25 =SUM(B3:C3) → 40 21.5384615385 18.4615384615
4 25 15 =SUM(B4:C4) → 40 21.5384615385 18.4615384615
6 =SUM(B2:B4) → 70 =SUM(C2:C4) → 60 =SUM(B6:C6) → 130 — —

Put the row-total formula =SUM(B2:C2) in D2 and fill through D4. Put the three column/grand-total formulas in B6, C6 and D6. To generate the expected counts automatically, enter this formula in E2 and fill right to F2, then fill E2:F2 down through row 4:

=$D2*B$6/$D$6

The row-total reference $D2 locks column D; B$6 locks the totals row and becomes C$6 for the second expected-count column; $D$6 locks the grand total. This is the contingency-table expectation row total × column total / grand total described by Apple. Check that E2:F4 sums to 130, matching B2:C4. Values were independently calculated; no Numbers worksheet was opened. [A1, A3, C1]

Then enter:

=CHITEST(B2:C4,E2:F4)

Expected outcome: approximately 0.043546385685296. The independently computed Pearson statistic is 6.267857142857144, with 2 degrees of freedom; the chi-square right tail gives that p-value. If a predeclared threshold is 0.05, the result would reject the independence null model at that threshold, but it says nothing by itself about practical importance, causation or sampling bias. The input expected values in this example all exceed 5, avoiding a common small-expected-cell warning. [C1]

Important Numbers table details

Numbers references cells within a table, not cells on an infinitely addressed Excel-style worksheet. If you put the calculated expected matrix in a different table named ExpectedCounts, change the function accordingly, such as:

=CHITEST(Responses::B2:C4,ExpectedCounts::B2:C4)

This cross-table formula is a documentation-based syntax example, not a native execution test. Ensure ranges align by row meaning and column meaning, regardless of table names. If either table gains a row, reassess the statistical model and corresponding range instead of automatically expanding only one range. [A3, C1]

Advanced applications and independent checks

Compare a more extreme p-value

If the two group distributions diverge more sharply, first calculate a new expected-count matrix from the new marginal totals, then evaluate CHITEST again. You cannot legitimately reuse expected counts generated from an earlier dataset. For a diagnostic, compute each Pearson contribution (O−E)^2/E alongside its corresponding cells. For the example above the statistic is 6.267857142857144; its pieces independently add to that value. These diagnostic formulas are mathematical checks rather than proof of a particular Numbers runtime. [C1]

Replicate Apple’s published example—without copying its statistical inconsistency

Apple supplies five rows of observed counts B3:C7:

15  9
56 35
11 23
10 23
 8 10

It also supplies a separate expected-values matrix B9:C13:

12.00 4.50
10.20 3.83
 4.92 1.85
 4.82 1.81
 4.21 1.58

Apple documents =CHITEST(B3:C7,B9:C13) returning about 1.3382569E-218; independently summing (O−E)^2/E produces a chi-square statistic of 1015.8088851246224, and a four-degree-of-freedom right-tail probability of 1.338256936691553 × 10⁻²¹⁸. [A1, C2]

Source accuracy note: The listed expected matrix sums to 49.72, while the listed observed matrix sums to 200. Therefore the published example’s expected matrix cannot be the row-total × column-total / grand-total expectation of those very observed counts, despite the accompanying prose saying to calculate it that way. Reproduce the numerical example only as an Apple-documented formula demonstration, not as a statistically valid independence test. Use the correctly normalized 3 × 2 worksheet earlier when teaching inference. This is an independently checked comparison against the official table, not an Apple correction notice. [A1, C2]

Keep statistical assumptions visible

The chi-square approximation can be unreliable with very small expected counts, related observations, nonexclusive categories, or opportunistically chosen group definitions. Record sample collection, missing-data treatment, expected-count generation, multiple testing and significance threshold separately. CHITEST does not validate those assumptions for you. A low p-value does not measure the effect’s magnitude. [C3]

Errors, limitations and troubleshooting

Situation What to check Evidence boundary
=CHITEST(B2:C4) Missing mandatory expected range Official syntax has exactly two required arguments [A1].
Actual and expected rectangles have different sizes Align corresponding rows and columns before calling the function Necessary for paired Pearson comparisons; Apple does not specify the exact UI error string [C1].
Any expected count is zero/negative Reassess the null model: (O−E)^2/E requires strictly positive E in used cells A mathematical restriction; do not invent a particular Numbers error result [C1].
Text labels, blanks, or locale-specific numbers in ranges Keep only validated numeric observation/expected cells in the selected rectangles Apple says numbers, but does not exhaustively document mixed-type coercion [A1].
Extremely tiny p-value displays 0 Inspect number formatting/precision and underlying model; a tiny probability is not always mathematically zero Display behaviour was not tested in Numbers [C2].
Formula returns a p-value, but significance seems surprising Recompute all row/column totals, expected values and degrees of freedom Independent model check; not a specific runtime guarantee [C1].
Multiple response columns/groups Apple documents rows minus one for degrees of freedom; check conventional (rows−1)×(columns−1) assumptions separately Avoid extrapolating vendor text beyond its stated case [A1, C1].
French/other non-English interface Check Numbers’ argument delimiter and localized function-name picker No blanket English-syntax compatibility promise [A2].

Missing evidence: Native Numbers tests on Mac, iPad, iPhone and iCloud; behaviour of malformed/mismatched ranges; exact runtime error strings; older releases; and formatting of underflow values. There are no screenshots, test-session claims or “verified in-app” assertions in this guide. [A1, A2]

Compatibility, version and sources

  • Current official scope: The English Apple Formulas and Functions Help 15.4 lists CHITEST as a statistical function and exposes its function reference. Verified against that documentation on 2026-10-13. This does not establish the version in which CHITEST first appeared, nor guarantee every historical Numbers release or third-party application accepts these inputs. [A1, A4]
  • Numbers execution status: NOT TESTED. Numerical results used independent Python/SciPy chi-square calculations and manual formula checks. Formula spelling, argument order and the “rows −1” note were checked from Apple documentation. [A1, C1, C2]
  • Locale/aliases: Canonical English name CHITEST. Localized function spellings may differ; select the appropriate name in the Functions Browser. [A2]
  • [C1] Independent mathematical calculations: Python/SciPy calculations reproduced the stated examples; these are not native Numbers tests.

Official references and claim-level provenance (checked 2026-10-13)

  • [A1] Official Apple, CHITEST — exact argument signature, numeric types, expected-value rule, degrees of freedom, source table and published example: https://support.apple.com/guide/functions/chitest-ffa5b20557/15.4/web/1.0
  • [A2] Official Apple, Formulas and Functions Help 15.4 — function syntax, locale and formula editor scope: https://support.apple.com/en-au/guide/functions/ffa148e9cd0/15.4/web/1.0
  • [A3] Official Apple, Refer to cells in formulas — Numbers table-qualified ranges and preserved cell references: https://support.apple.com/en-au/guide/functions/ffa550d691/15.4/web/1.0
  • [A4] Official Apple, current statistical-function catalogue — name/canonical status, CHIDIST and CHIINV as related concepts: https://support.apple.com/guide/functions/ffa148e9cd0/web
  • [C1] Independent model check: Python 3 + SciPy scipy.stats.chi2_contingency (correction=False) on observed 3×2 counts; scipy.stats.chi2.sf for right tail, manual row and column totals; results are NOT native Numbers outputs.
  • [C2] Independent source-data discrepancy audit: Compare the two explicit matrices in [A1]; sum observed=200, expected=49.72, sum((O−E)^2/E)=1015.8088851246224, four-degree right-tail 1.338256936691553e−218. These are independent computations of the displayed data, not Apple errata.
  • [C3] General statistical caution: Chi-square assumptions and inference limitations are methodological discussion, not additional Apple runtime claims.