How to perform a Chi-Square Goodness of Fit Test in Google Sheets (Step-by-Step)

A Chi-Square Goodness of Fit Test is a statistical test used to compare observed counts of data with expected counts. To perform a Chi-Square Goodness of Fit Test in Google Sheets, first enter the observed counts of the data into a table, then enter the expected counts into the table. Next, use the CHITEST function to calculate the Chi-Square statistic and the associated p-value. Finally, interpret the results of the test based on the p-value to determine if the observed and expected counts differ significantly.

A is used to determine whether or not a categorical variable follows a hypothesized distribution.

For example, suppose a shop owner claims that an equal number of customers come into his shop each weekday.

To test this hypothesis, an independent researcher records the number of customers that come into the shop on a given week and finds the following:

  • Monday: 50 customers
  • Tuesday: 60 customers
  • Wednesday: 40 customers
  • Thursday: 47 customers
  • Friday: 53 customers

We can perform a Chi-Square Goodness of Fit Test to determine if the data is consistent with the shop owner’s claim.

This following step-by-step example shows how to perform a Chi-Square Goodness of Fit Test in Google Sheets.

Step 1: Create the Data

First, let’s input the data into Google Sheets in the following format:

Note: There were 250 customers total. If the shop owner expects an equal number to come into the shop each day then he would expect 50 customers per day.

Step 2: Calculate the Difference Between Observed and Expected Values

The Chi-Square test statistic for the Goodness of Fit test is X2 = Σ(O-E)2 / E


  • Σ: is a fancy symbol that means “sum”
  • O: observed value
  • E: expected value

The following formula shows how to calculate (O-E)2 / E for each row:

Step 3: Calculate the P-Value

Chi-square test in Excel

Note: The function CHISQ.DIST.RT(x, deg_freedom) returns the right-tailed probability of the Chi-Square distribution associated with a test statistic and a certain degrees of freedom. The degrees of freedom is calculated as n-1. In this case, deg_freedom = 5 – 1 = 4.

The X2 test statistic for the test is 4.36 and the corresponding p-value is 0.3595.

Since this p-value is not less than 0.05, we fail to reject the null hypothesis. This means we do not have sufficient evidence to say that the true distribution of customers is different from the distribution that the shop owner claimed.