How to Create a Contingency Table in Excel
A contingency table, also known as a crosstab is used to show the relationship between two categorical variables. In Excel, we can make a contingency table using the pivot table function. They are best for summarizing the relationship between categorical variables. A Contingency table is just like a frequency distribution table in which we can show two variables simultaneously. To further derive results from a Contingency table, chi-square tests are used. In this article, we will learn how to create a Contingency Table.

Create a Contingency Table in Excel
What is a Contingency Table in Excel
A contingency table in Excel, also known as a cross-tabulation or crosstab, is a statistical tool used to summarize the relationship between two or more categorical variables. It displays the frequency distribution of the variables in a matrix format, making it easier to analyze the data and identify patterns or correlations.
How to Make a Contingency Table in Excel
Let us take the following dataset and convert it into a contingency table. This dataset consists of product IDs, product names, and the product manufacturer. The dataset that you want to convert into a contingency table can have any number of rows or columns. Follow the following steps to create the contingency table from this dataset.
Step 1: Choose the PivotTable option from the Insert tab. This will open a dialog box.
Step 2: Choose the range value in Dialouge box
In the dialog box that appears, choose the range of values as $A1:$C6 and then choose another cell in the sheet where you want to place the pivot table. Here, we have chosen cell G1. The range of values is the entire space that contains the dataset.
Step 3: Click OK to see the Contingency Table
Now click ok and you will see an empty contingency table in the G1 cell. It appears in the G1 cell because that was what we chose in the location in Step 2.
Step 4: Fill the Populated table
Now, we have to populate the table. In other words, we have to fill this empty table with the dataset values. But, we do not have to do this manually. In the window on the left, drag Manufacturer into the box named Rows, drag Names into the box named Columns, and drag Id in the box named Values.
Notice that the frequency values are automatically populated in the contingency table. This is the required contingency table for the dataset assumed above. Now when we have successfully created the contingency table, let us see how we can read it to derive useful information from it.
Interpretation of the Contingency Tablechose
One of the major advantages of using a Contingency table is that it makes the visualization of the relationship between variables very easy. We can interpret a Contingency table based on rows, columns as well as cells.
Based on the Table total
- 2 products are made by manufacturer X.
- 1 product is made by manufacturer Y.
- 2 products are made by manufacturer Z.
Based on the column total
- Milk sold was 1.
- Soya sold were 2.
- Tofu sold was 2.
Based on individual cells
- 2 Tofus were purchased from Manufacturer X.
- 1 Milk was purchased from Manufacturer Y.
- 2 Soyas were purchased from Manufacturer Z.
Conclusion
Contingency tables, also known as crosstabs, are powerful tools in Excel for analyzing relationships between categorical variables. By utilizing the PivotTable function and dragging your data fields, you can quickly create these tables to identify trends and gain insights from your data. Remember, you can also perform chi-square tests using the CHISQ.TEST function to assess the statistical significance of the relationships found in your contingency table.
FAQs – Make Contingency Table in MS Excel
How do I make a contingency table in Excel?
You can create a contingency table using the PivotTable function. Here’s a quick rundown:
- Select your data range.
- Go to Insert tab > PivotTable.
- Choose where to place the table and click OK.
- Drag and drop fields into the Rows and Columns sections to organize your data.
What are contingency tables known as in Excel?
Contingency tables are also known as crosstab tables in Excel.
How to calculate chi square contingency table in Excel?
To calculate a chi-square test for your contingency table, you’ll need to use the CHISQ.TEST function in Excel. This function requires entering the table range and expected values (often left blank for calculation). For help with the function, you can search for it within Excel or refer to online documentation.