How To Create A Crosstab In Excel

Creating a crosstab in Excel is a helpful way to summarize the relationship for a larger dataset containing categorical variables.

When we have a data set containing a large number of variables, it can be frustrating and time-consuming to go through all the variables one by one. Furthermore, it is not an efficient method to identify a pattern or trend in the data set.

Cross tabulation, in short, crosstab, is an extremely common statistical analysis tool. Crosstabs are often used to summarize a more extensive data set which can help us easily analyze the relationship between the variables. 

When we utilize cross tabs, we can save time and be more efficient in our work.

Let’s take a sample scenario.

Suppose we have finished surveying people’s favorite pets. So there were a total of 100 participants. Instead of going through each participant’s answer, we simply created a cross tab to identify the count for each pet.

Moreover, we can create categories to further analyze the data. For example, we can group the data by age and gender in our cross tab. 

In this guide, we will teach you how to easily create crosstabs in Excel using the pivot table feature.

Great! Let’s dive into a real example of creating a crosstab in Excel.

A Real Example of Creating A Crosstab in Excel

Let’s say we have a data set containing data from a survey about people’s favorite fruits. And we have a sample of 30 people. So our initial data set would look like this:

Initial dataset

 

We can manually create a crosstab in Excel by making a table containing the different variables in our data set. We want to identify the participants’ favorite fruits by gender. Firstly, we will place the genders as our row labels. Secondly, the different fruits as our column label.

Then, we would simply count the number of participants who chose what fruit by gender. Next, we can input a total sum of counts per category. And tada! We have created a crosstab. However, this process is too long, especially when dealing with larger data sets. Instead, we can utilize pivot tables to easily create our crosstabs in Excel.

In Excel, pivot tables are a powerful feature that is used to calculate, summarize, and analyze large data. This allows us to see patterns, trends, and even comparisons in our data set.

Another advantage of using the pivot table to create a cross tab is its interactive function and flexibility. For instance, we can easily customize how we want to group the variables. If we want to group the variables by age, we can simply drag the age in the row label. If we want to group them by gender, we can input gender in the row label. We can even group the variables by both gender and age!

With the pivot table options, we can easily customize and format our crosstabs according to the appropriate situation. 

When we select columns from the data set to display in our pivot tables, we must ensure we select the whole columns, including the headers. Furthermore, we need to ensure we place the correct variables in the correct fields. Although we can still fix the issue, it includes more work.

So our final data set would look like this:

Final dataset

 

You can make your own copy of the spreadsheet above using the link attached below. 

Amazing! Now we can move on and explain the process of how to create a crosstab in Excel.

How to Create A Crosstab in Excel

In this section, we will explain the step-by-step process of creating a crosstab in Excel using a pivot table. Furthermore, each step has detailed instructions and pictures to guide you along the process.

1. Firstly, we will select the columns we need to display in our crosstab. In this case, we will select Gender and Favorite Fruit. Secondly, we will go to the Insert tab and click PivotTable found in the Tables section.

Create A Crosstab in Excel

 

2. In the Create PivotTable window, we will choose Existing Worksheet and input a location to display the table. In this case, we will input “$F$1”. Lastly, we will click OK to apply the changes.

Create A Crosstab in Excel

 

If you want to display the crosstab in another worksheet, you can select New Worksheet instead. 

3. Next, we will go to the PivotTable Fields section on the worksheet’s right side. So this is where we will decide how we want to group our variables. In this case, we will drag Favorite Fruit to the Columns section. 

Then, we will drag Gender to the Rows section. Lastly, we will drag Favorite Fruit again but this time to the Values section.

Create A Crosstab in Excel

 

4. And tada! We have successfully created a crosstab in Excel using a pivot table.

Create A Crosstab in Excel

 


Frequently Asked Questions (FAQ)

1. How to eliminate null values in my crosstab?

We can simply right-click on any cell in the crosstab and select PivotTable Options in the menu. In the PivotTable Options window, we will head over to Layout & Formant. Then, we will check the box For empty cells show option and input the value “0”. Lastly, we will click OK.

2.  Can I group age variables in my crosstab?

Yes! We can group values in pivot tables. And we can group age variables or any numerical variables in our cross tab. 

To do this, we simply right-click any cell in the crosstab and select Group in the menu. Then, we can input the necessary intervals we need in our groupings. 

3. Is crosstab the same as pivot table?

Similar, but not really! Crosstabs and pivot tables are almost identical in format, and the terms are used interchangeably. But, the pivot table has more benefits than normal crosstabs, such as automatic counting, grouping variables, and format options. 

And that’s pretty much it! We have successfully learned how to create a crosstab in Excel using the pivot table feature. Now you can apply this learning to your work whenever you need to summarize a larger data set. 

Are you interested in learning more about what Excel can do? You can now use the various other Microsoft Excel formulas available to create great worksheets that work for you. Make sure to subscribe to our newsletter to be the first to know about the latest guides and tutorials from us.

Get emails from us about Google Sheets.

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'll love what we are working on! Readers receive early access to new content.

0 Shares:
Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like