# WorksheetFunction.ChiSq_Test (Excel)

Returns the test for independence.

ChiSq_Test returns the value from the chi-squared (χ2) distribution for the statistic and the appropriate degrees of freedom. You can use χ2 tests to determine whether hypothesized results are verified by an experiment. If actual_range and expected_range have a different number of data points, ChiSq_Test returns the #N/A error value. The χ2 test first calculates an χ2 statistic by using the following formula, where:

**ChiSq_Test** (Arg1, Arg2)

```
Dim dblChiSq_Test As Double
dblChiSq_Test = WorksheetFunction.ChiSq_Test(Arg1:=, Arg2:=)
```

## Arguments

Arg1, Arg2Arg1 - The range of data that contains observations to test against expected values

Arg2 - The range of data that contains the ratio of the product of row totals and column totals to the grand total