# How To Use CHIDIST Function in Google Sheets

The CHIDIST function in Google Sheets is useful when you need to calculate the right-tailed chi-squared distribution of a given input.

The chi-squared distribution is often used in hypothesis testing. It is often used to test the goodness of fit of a distribution of data and whether data series are independent.

The rules for using the CHIDIST function in Google Sheets are as follows:

• The function requires two arguments: the input of the probability distribution function and the degrees of freedom.
• The function then outputs the value of the right-tailed chi-squared distribution.

Let’s begin with a quick use case.

In this example, let’s say we would like to figure out whether a particular ad is more effective for a particular gender. Ad analytics was able to give us a dataset of 180 users, with 100 male participants and 80 female participants. We have data on which ads they decided to click. Is it possible to determine whether gender has a significant effect on whether the user decides to click the advertisement.

With the CHIDIST function, we can easily compute the probability that the results follow a random distribution or are skewed in a particular way. The probability for dependence is usually a probability less than 0.05. If the result of CHIDIST is less than 0.05, this means there is a significant dependence between the variables.

Now that we’ve seen an example of when to use the CHIDIST function, let’s explore how to set up this function.

## The Anatomy of the CHIDIST Function

The syntax of the CHIDIST function is as follows:

=CHIDIST(x, degrees_freedom)

Let’s look at each term to understand what they mean.

• = the equal sign is the indicator that we’ll be using a function in Google Sheets.
• CHIDIST() is our CHIDIST function. It computes the right-tailed chi-squared distribution.
• x refers to the input of the chi-squared probability distribution function.
• degrees_freedom refers to the number of degrees of freedom of the distribution.
• The argument x must have a positive value.
• CHIDIST will truncate the degrees_freedom argument to an integer if a non-integer is given.
• The degrees_freedom argument must have a value of at least 1 and must be less than 10^10.

## A Real Example of Using CHIDIST Function

Let’s look at an example of the CHIDIST function being used in a Google Sheets spreadsheet.

In the table below, we computed for the chi-square of the dataset as seen in cell B6. The chi-square value was computed by using the formula seen in column D. The observed result refers to the actual observed users who fall into that category. Meanwhile, the expected results refer to the expected distribution for each category (assuming no dependence).

To calculate the value seen in cell B7, we can use the following formula:

=CHIDIST(B6,1)

The ‘1’ in the formula above refers to the degrees of freedom of the given dataset. The degrees of freedom can be computed using the following formula: (rows − 1) × (columns − 1). In this case, we only have two “rows” (male and female) and two columns  (clicked and did not click the ad).

If you would like to work with a copy of the spreadsheet above, use the link below to create your own copy.

In the next section, we’ll follow a step-by-step guide on how we can begin writing the CHIDIST function in Google Sheets.

## How to Use CHIDIST Function in Google Sheets

1. Given a dataset, it’s important to set up the table to get the chi-square result easily. Aligning the categories with two columns for observed and expected results will help us compute the chi-square test. In this example, we’ve arrived at a chi-square test result of 10.25.

2. Select the cell where we will put our function’s output. In this example, we’ll return the CHIDIST output in cell B7.
3. In the selected cell, type in the equal sign followed by ‘CHIDIST(‘.
4. A tooltip box appears with tips on how to use the CHIDIST function. We can click on the arrow in the top-right-hand corner of the box to remove it from view if needed.

5. Next, we need to add in our arguments. We know the chi-square test result, as well as the degrees of freedom.

In this particular example, we have a probability that is much less than 0.05. This makes it likely that there is a relationship between gender and the click rate of this particular ad.

1. Why does my formula return a #VALUE! error?
All arguments for the CHIDIST function must be numeric. Non-numeric values will lead to a #VALUE! error in your result.
2. Why does my formula return a #NUM! error?
Make sure that the value of x is greater than 0. Also, make sure that the degree_freedom argument is not less than 1 or higher than 10^10.

Following this guide should show how easy it is to find the right-tailed chi-squared distribution of two variables. We can use the CHIDIST function to determine dependence between variables in your dataset easily.

You can now use the CHIDIST functions in Google Sheets together with the various other Google Sheets formulas available to create powerful spreadsheets that are easy to set up.

Our goal this year is to create lots of rich, bite-sized tutorials for Google Sheets users like you. If you liked this one, you'd love what we are working on! Readers receive ✨ early access ✨ to new content.

## How to Use PRICEMAT Function in Google Sheets

This guide will explain how to use the PRICEMAT function in Google Sheets. When we need to calculate…

## How to Use DVAR Function in Google Sheets

The DVAR function in Google Sheets is useful if you need to estimate the variance of a population,…

## How to Use FINDB Function in Google Sheets

This guide will explain how to use the FINDB function in Google Sheets. In the context of text…

## How to Use SPLIT Function in Google Sheets

The SPLIT function in Google Sheets is useful to quickly and easily separate text into columns based on…