The CHISQ.TEST function can be used to perform the Chi-square test easily in Google Sheets:
The syntax for the function is CHISQ.TEST(actual_range, expected_range), where:
Here's how you can apply it:
First, you need to organize your data into a contingency table format. Suppose you're looking at the relationship between Gender (Male/Female) and Preference for a new product (Like/Dislike). Your table might look something like this:
Before using the CHISQ.TEST function, you need to calculate the expected frequencies for each category based on your total observations. The formula for expected frequency is: (Row Total * Column Total) / Grand Total.
For example, for the "Male (Like)" category:
Row Total for Male = 50
Column Total for Like = 45
Grand Total = 100
The expected frequency for Male who like the product would be (50 * 45) / 100 = 22.5.
You'll need to calculate this for each cell in your contingency table.
Assuming observed frequencies are in B2:C3 and expected frequencies are in E2:F3, your Chi-square formula will be:
=CHISQ.TEST(B2:C3, E2:F3)
Press Enter to execute the formula. This will give you the chi-square test statistic.
The result of the chi-square test will give you a p-value.
We hope that this article has helped you and given you a better understanding of how to do a chi square test in Google Sheets. If you enjoyed this article, you might also like our articles on how to use Autocrat for Google Sheets and how to combine ARRAYFORMULA with FILTER in Google Sheets.