How to Create a Contingency Table in Excel
Last Updated :
16 May, 2025
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 blog, you’ll learn step-by-step how to create a contingency table in Excel, with easy examples and clear visuals. You’ll also discover tips on using tools like pivot tables to automate and enhance your analysis.
Create a Contingency Table in ExcelWhat 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
Choose the PivotTable from the Insert tab. This will open a below 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 Covariance Matrix in Excel?
Covariance is a statistical term that signifies the direction of the linear relationship between two variables. The direction usually refers to whether the variables vary directly or inversely to each other. It should be remembered that covariance only measures how two variables change together, it
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. Tolerance Chart Steps for creating a Tolerance Chart Follow the below steps to create a To
2 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 a Stem-and-Leaf Plot in Excel?
Stem and Leaf plot is a histogram tabulation of data. Stem and leaf plot is better for data visualization and cleanliness of the data in a certified range. The plot helps determine the frequency distribution of the data. In this article, we will learn how to create a stem and leaf plot in excel. Ste
5 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
How to Create a Dynamic Chart Range in Excel?
A Dynamic chart range is the range of a data set which automatically updates on any modifications in the original data set. It is beneficial because at some point in time we need to add or delete data from the original data set. So, we want a method to automatically update the chart on performing an
5 min read
How To Create A Pictograph In Excel?
The Pictograph is the record consisting of pictorial symbols. Generally, in mathematics, it is represented by the help of graphs with pictures or icons representing certain quantities or numbers of people, books, etc. It is also known as pictogram, pictogramme, pictorial chart, picture graph, or sim
3 min read