How to Create a Contingency Table in Excel
Last Updated :
21 Jun, 2024
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.
- 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.
Similar Reads
How to Create a Line Chart in Excel
Line graphs are a highly valuable tool in Excel, helping users analyze trends and patterns effectively over time. They are widely used for time-series analysis in Excel, allowing a clear visual representation of changes in data. In this guide, you'll learn how to create a line graph in Excel, includ
10 min read
How to Create a Step Chart in Excel
A step chart is used to represent data that changes irregularly between time intervals. Now, Excel doesn't have a feature to create a Step Chart like the one shown below but we can create one by making some changes in our data. What is a Step Chart in ExcelA Step chart is the same as a Line Chart. T
4 min read
How to Create a Rolling Chart in Excel?
A chart range is a data range that automatically updates as the data source is changed. This dynamic range is then utilized in a graphic as the source data. As the data changes, the dynamic range updates instantaneously, causing the chart to refresh. A common necessity when developing reports in Exc
3 min read
How to Create a Power PivotTable in Excel?
When we have to compare the data (such as name/product/items, etc.) between any of the columns in excel then we can easily do with the help of Pivot table and pivot charts. But it fails when it comes to comparing those data which are in two different datasets, at that time Power Pivot comes into rol
4 min read
How to Create a Bar Chart in Excel?
To learn how to create a Column and Bar chart in Excel, let's use a simple example of marks secured by some students in Science and Maths that we want to show in a chart format. Note that a column chart is one that presents our data in vertical columns. A bar graph is extremely similar in terms of t
4 min read
How to Create a Tolerance Chart in Excel?
A tolerance chart shows how a particular data item compares to the maximum and minimum permissible values. In this article, we'll analyze the average results of the students of a class using a tolerance chart. Steps for creating a Tolerance Chart Follow the below steps to create a Tolerance chart in
2 min read
How to Create a Scatter Plot In Excel?
A scatter plot in Excel is a powerful visualization tool for identifying trends, relationships, and patterns between two variables. By plotting data points on an Excel XY scatter plot, you can gain insights into correlations and outliers, making it an essential tool for data analysis. Whether youâre
7 min read
How to Create a Thermometer Chart in Excel?
The Thermometer chart in Excel can be used to depict specific data based on the actual value and the target value. It can be used in a wide range of scenarios such as representing the past performance of horses in horse racing or the global temperature and it's variation throughout decades etc. In t
2 min read
How to Create a Bland-Altman Plot in Excel?
Bland-Altman plot is not present by default in excel, but it can be easily built with the help of excel. There is software that provides in-built Bland-Altman plots like MedCalc, Analyse-it, etc. In this article, we will learn how to create a Bland-Altman plot in excel. A Bland-Altman plot is used t
8 min read
How To Create Interactive Charts in Excel?
In MS Excel, we can draw various charts, but among them today, we will see the interactive chart. By name, we can analyze that the chart, which is made up of interactive features, is known as an interactive chart. In general, this chart makes the representation in a better and more user-friendly way
9 min read