Compatibility
CHITEST
Matches all 7 recorded answers
Recorded: 7 workbook cells. How we measure this · See the Rust code
Local names in 40 languages
| Language | Name in Excel |
|---|---|
| Arabic | CHITEST |
| Bulgarian | CHITEST |
| Czech | CHITEST |
| Danish | CHITEST |
| German | CHITEST |
| Greek | CHITEST |
| English (Australia) | CHITEST |
| English (United Kingdom) | CHITEST |
| English (United States) | CHITEST |
| Spanish | PRUEBA.CHI |
| Estonian | CHITEST |
| Finnish | CHITESTI |
| French | TEST.KHIDEUX |
| Hebrew | CHITEST |
| Croatian | CHITEST |
| Hungarian | KHI.PRÓBA |
| Indonesian | CHITEST |
| Italian | CHITEST |
| Japanese | CHITEST |
| Korean | CHITEST |
| Lithuanian | CHITEST |
| Latvian | CHITEST |
| Norwegian | CHITEST |
| Dutch | CHI.TOETS |
| Polish | TEST.CHI |
| Portuguese (Brazil) | QUITEST |
| Portuguese (Portugal) | TESTE.CHI |
| Romanian | CHITEST |
| Russian | ХИ2ТЕСТ |
| Slovak | CHITEST |
| Slovenian | CHITEST |
| Serbian (Latin) | CHITEST |
| Swedish | CHI2TEST |
| Thai | CHITEST |
| Turkish | KİKARETEST işlevi |
| Ukrainian | CHITEST |
| Vietnamese | CHITEST |
| Chinese (Simplified) | CHITEST |
| Chinese (Hong Kong) | CHITEST |
| Chinese (Traditional) | CHITEST |
Names from Microsoft's support site.
What it does
CHITEST(actual_range, expected_range)
CHITEST(actual_range, expected_range) returns a chi-square right-tail test probability from observed and expected frequencies. Supply the expected counts explicitly; the function does not infer them from labels. CHITEST is the compatibility spelling.
Try it
=CHITEST({12,8},{10,10}) is about 0.37109337. The statistic is (12-10)^2/10+(8-10)^2/10=0.8, with one degree of freedom for a one-row, two-category comparison.
Quirks
The arrays need matching shapes; a mismatch gives #N/A in the current wrapper. A one-cell comparison also gives #N/A because it supplies no positive degree count. The output is a tail probability, rather than the chi-square statistic itself.
The current wrapper requires a numeric value at every paired position and returns #VALUE! for text, logical or blank cells; it does not compact those cells into a shorter sample. It propagates a direct argument error before comparing shapes, then checks cell errors during traversal. A nonpositive expected count gives #NUM! in this code.
For an independence table, calculate expected counts from row total times column total divided by grand total before calling the function. The function takes those expected values as inputs. Its p-value is conditional on the chosen model and expected table.
How to implement
- Resolve the two input grids and retain their row and column counts. Propagate a direct scalar argument error before a shape mismatch. Reject unequal shapes.
- Set degrees of freedom to
(rows-1)*(columns-1)when both dimensions exceed one,columns-1for one row orrows-1for one column. Reject zero degrees. - Traverse paired positions in row order. Propagate a cell error, require two numbers and reject a nonpositive expected value under the current rules.
- With ordinary binary64 stores, form
delta=actual-expected,square=delta*delta,contribution=square/expectedandstatistic=statistic+contributionfrom an initial zero. - Evaluate the chi-square right tail at that stored statistic and degree count.
The starter example contributes 4/10=0.4 from each category, giving statistic 0.8 and one degree. For an independence layout {12,8;8,12}, both row totals and both column totals are twenty and the grand total forty, so every expected count is ten. Its four contributions total 1.6, still with one degree because (2-1)*(2-1)=1.
Keep admission, statistic reduction and the numerical right-tail routine as separate stages. The loop describes current code; the forward distribution’s last bits and other recorded residuals remain unresolved.
Rust code
Show the CalcFunc source of this function
Quoted from the public repository DnaCalc/DnaCalc, crates calc-func and calc-fml, at commit 9e1884369a67. Comments are the source's own. A kernel shared with other functions appears once, on its module page.
CHITEST · 3 lines · calc-func/src/catalogue/distributions.rs on GitHub101 chitest "CHITEST" (2, 2) [R "actual_range", R "expected_range"] |s, a, sv| {
chisq_test_of(s, a, sv)
}
Kernels shared with other functions
chisq_test_ofcatalogue/distributionstruncate_positive_integerported/chi_f_t_familyvalidate_nonnegative_xported/chi_f_t_familychisq_dist_rt_kernelported/chi_f_t_familybinary_withported/excel_numericexcel_expm1_internalported/excel_numericexpm1_internal_graphported/excel_numericexcel_x87_addported/excel_numericexcel_x87_subported/excel_numericexcel_x87_mulported/excel_numericexcel_x87_temme_finishported/excel_numericexcel_x87_divported/excel_numericmulported/excel_numeric/x87addported/excel_numeric/x87subported/excel_numeric/x87divported/excel_numeric/x87pow2_positiveported/excel_numeric/x87_chainspow2ported/excel_numeric/x87_chainsexp_extported/excel_numeric/x87_chainsexp_withported/excel_numeric/x87_chainsexcel_expported/excel_numeric/x87_chainslog_withported/excel_numeric/x87_chainsexcel_logported/excel_numeric/x87_chainsstored_hornerported/normal_dist_commonerf_approxported/normal_dist_commonerfc_upperported/normal_dist_commonerfc_of_sqrt_half_xported/special_dist_familyerfc_kernelported/special_dist_familyerfc_precise_kernelported/special_dist_familygratio_norm_gammaported/special_math_commongratio_rexpported/special_math_commongratio_rlogported/special_math_commongratio_gam1ported/special_math_commongratioported/special_math_commonseries_prefactorported/special_math_commongratio_after40ported/special_math_commongratio_cfported/special_math_commongratio_temme_270ported/special_math_commongratio_temme_340ported/special_math_commongratio_temme_330ported/special_math_commongratio_temme_finishported/special_math_commonregularized_gamma_qported/special_math_common
Argument and result plumbing
No implementation has been published with a Handbook test suite for this function.
Version differences
No same-input comparison between named Excel builds is recorded for this function here. The documented behaviour below is not a measurement of every Excel release.
Alternatives
CHISQ.DIST.RT evaluates a supplied statistic; CHISQ.INV.RT finds a critical value. F.TEST compares sample variances.
Named variants
No named variants are recorded yet.
Suggest a correction or contribute an implementation · For agents