Creating Cross-Tabulations in Excel: Step-by-Step Process and Examples

UPI Study › Courses › Marketing Research › Free lessons › Lesson 10.5 Free lesson

Creating Cross-Tabulations in Excel: Step-by-Step Process and Examples

Marketing Research · Chapter 10: Categorical Analysis, Cross-Tabulation, and Descriptive vs. Inferential StatisticsSection 10.5 · lesson 73 of 10111 min · free to watch

← Cross-Tabulation Reports: Finding Patterns Across Consumer GroupsNext lesson: Descriptive vs. Inferential Statistics: What They Are and When to Use Each →

Earn 3 college credits for Marketing ResearchRecommended for credit by NCCRS · Marketing 300 · self-paced · one payment, lifetime access

In this lesson

Build cross-tabs in Excel with a PivotTable and with COUNTIFS.

  • Build a cross-tabulation with an Excel PivotTable step by step
  • Switch PivotTable values to a percent of the column, the row or the grand total
  • Build the same table with COUNTIFS and check it against the PivotTable
  • Choose between a PivotTable and a formula table for a file others will edit

Free study notes

Get this lesson's notes by email

The key points and 4 practice questions with answers, in your inbox. One email, free.

One email. Unsubscribe in one click.

Transcript

Everything said in the video, section by section (1,501 words). Read along, or search it.

Opening Question

Same Table, Built Without Python

In lesson 10.4, Grace's cross-tab came from Python. But Nadia does not use Python. And neither does Leo. Their world is Excel. The good news is that Excel can build the same table, in two different ways. A few clicks with a PivotTable. Or a formula, called COUNTIFS. In this hands-on lesson, you will learn both. And you will know when to use which.

Fernway Snacks is a composite case built for teaching. The forty shoppers, and their answers, are invented. But the two methods are exactly the ones a marketing analyst uses, every week, to turn a survey list into a report.

In this lesson, you will build a cross-tabulation with a PivotTable, step by step. You will switch the values to a percent of the column, the row, or the grand total. And you will build the same table with COUNTIFS, and check it against the PivotTable.

Data Setup

A Tidy List Comes First

First: set up the data. Both methods need the same thing. A tidy list. That sounds dull. But a messy list is behind most broken reports.

Put the survey in a sheet, with one row per shopper, and one column per question. Put a clear heading on top of each column. Grace's list has the shopper ID in column A. The channel is in column B. And the buy again answer is in column C. The 40 shoppers sit in rows 2 to 41.

Data Rules

No Blanks, No Merges, Consistent Spelling

There are three more rules. No blank rows. No merged cells. And each answer is typed the same way, every time. So it is always corner, never corner in one row, and corner store in another. To a spreadsheet, those are two different answers. And your table would quietly split one group in two. Nobody would get an error message. The totals would still add up. But corner shoppers would be counted in two separate columns. That is why tidy data comes first, before any table. Coding and recoding columns was covered in lesson 9.1.

PivotTable Steps

Insert a PivotTable and Drag Fields

Next: method one, a PivotTable, step by step. A PivotTable is Excel's tool for summarizing a list, by dragging fields around. There is no formula to write. You tell Excel what goes where. And it does the counting. That makes it fast. You can try one layout, look at it, and drag the fields somewhere else in seconds.

The routine takes about five clicks. First, click any cell inside the data. For example, cell B5. Then, on the ribbon, choose insert, then PivotTable. Excel fills in the range, from A1 to C41. Choose new worksheet, and click OK.

Now the fields pane opens. This is where the table takes shape. Drag the answer field into rows. Drag channel to the columns area. Then drag buy again a second time, into the values area. Excel counts the answers because they are words. And it labels the result, count of buy again.

Show Values As

Percent of Column, Row or Total

Here is the count table it builds. Excel lists the channels in alphabetical order. Corner, then grocery, then online. In the no row, that is 7, 6, and 3. In the yes row, it is 4, 9, and 11. The grand totals are 16 no, and 24 yes. Forty in all.

Now the percentages. Right-click any number in the table. Choose show values as. Then pick a percent of the column total. The other choices are a percent of the row total, and a percent of the grand total. Same table. The chosen display option changed. The counts do not move. Only the number you divide by changes. The menu wording can differ a little between Excel versions. But the idea is always the same.

With the column setting, the yes row reads 36.36% for corner. It reads 60.00% for grocery. And it reads 78.57% for online. Each channel column now adds to 100.00%.

Choosing a Base

Eleven Shoppers, Three Percentages

Which setting is right? It is the same decision as in lesson ten point four. Percent within the groups you compare. Here, the channels are the columns. So the column setting answers this question. Of the online shoppers, what share would buy again?

Python confirms the numbers for one cell, online and yes. That is eleven shoppers, under all three settings. And here is the striking part. The same eleven shoppers give three different percentages.

They are seventy eight point five seven percent of the online shoppers. They are 45.83% of the yes group. And they are 27.50% of everyone. The count is fixed. The base you divide by is your choice. And that choice changes the story.

Common Mistake

Refresh a Stale PivotTable

What does it mean? Before you show any percentage, say what it is a percent of. Of online shoppers? Of loyal shoppers? Of everyone? Each one is true. But each one supports a different sentence in your report. Twenty seven point five percent of all shoppers are loyal online shoppers. That sentence is about the whole market. Seventy eight point five seven percent of online shoppers are loyal. That sentence is about one channel. Mixing them up is how a report says something its data never said.

Here is a common mistake. Someone edits the data, and expects the summary to change. But a PivotTable keeps its own summary, until you refresh it. So right-click inside the table, and choose refresh. If the table ever seems stuck, refresh first. It is the first thing to try. A stale table can look perfectly normal. It has neat totals, and tidy percentages. It just describes data that no longer exists.

COUNTIFS

Counting Rows That Meet Two Conditions

Finally: method two, the COUNTIFS formula. COUNTIFS counts the rows where all your conditions are true at once. Each condition is a pair. First a range. Then the value to match.

For example, count online shoppers who said yes. The first range is column B, rows two to forty one, matched to the word online. The second range is column C, matched to the word yes. It returns eleven. That matches the PivotTable. And it matches the first line of the Python output.

Typing words into every formula would be slow. So, to build the whole table with one formula, replace the typed words with cell references. In cell F2, the formula reads the channel name from row 1, and the answer from column E.

Dollar Signs

Mixed References Lock Row or Column

Now look at the dollar signs. They lock the ranges, so the data never slides. F dollar one locks the row. So the channel name always comes from row one. And dollar E two locks the column. So the answer always comes from column E. Getting those dollar signs right is the whole trick. Lock too little, and the formula drifts away from the data. Lock too much, and every cell repeats the same count.

Copy that one cell across, to H4, and every cell adjusts correctly. Row four uses SUM, for the totals. And for percentages, divide a cell by its column total. That is F two, divided by F dollar four.

Here is how it plays out at Fernway. Grace builds the PivotTable in two minutes, for Nadia's meeting. Then Leo asks her to add a column for flavor. And he wants the sheet sent to Victor, the outside supplier. Victor will update it next week. Like everyone at Fernway, he is part of our composite case.

Choosing a Method

Formulas for Files Others Will Edit

Grace uses the COUNTIFS table for that file. She knows the PivotTable would work today. But next week, it would quietly show old counts, unless someone remembered to refresh it. Why? Because its numbers refresh by themselves, as soon as the data change. There is nothing to remember. A PivotTable is perfect for a quick answer, in a meeting. A formula table is safer for a file that other people will keep editing.

Pro Tip

Build It Both Ways and Compare

And a pro tip. Build the table both ways, once, and compare the numbers. If two cells disagree, look for a typo in the data, such as a trailing space. Both tools match text exactly. So the word online, followed by a space, is a different answer from online. You cannot see the space. But the count can. The same goes for small spelling slips, such as corner store in one row, and corner in the next. Two methods that agree give you real confidence in the table. And the chi-square test for a cross-tab comes later, in lesson 11.1.

Try it yourself. Type a short list of ten friends, with two columns. Where they shop, and whether they like a snack. Build the PivotTable first. Then build the same table with COUNTIFS. Do the two agree? Then switch the PivotTable to a percent of the column total, and write one sentence about the pattern.

Key Takeaways

PivotTable Versus COUNTIFS in Brief

Key takeaways. A PivotTable builds a cross-tab, by dragging fields into rows, columns, and values. Show values as switches between counts, and percentages of the column, row, or grand total. COUNTIFS builds the same table, with a formula that updates by itself. Check that the table total matches the sample size. Next, lesson 10.6 asks what these summaries can show, and what they cannot. This lesson was made by UPI Study.

About Marketing Research at UPI Study

Marketing Research (Marketing 300) is a self-paced online course of 101 video lessons in 13 chapters, from consumer behavior, segmentation and the research process to qualitative methods, surveys and sampling, measurement, experiments, secondary and syndicated data, descriptive statistics, hypothesis tests, correlation and regression, research ethics and reports. It carries a NCCRS credit recommendation for 3 semester credits.

Every lesson transcript is free on pages like this one, and the videos are free with a free UPI Study account. Enrolling adds a practice quiz after each lesson, the graded work and final exam that earn the credit, lifetime access, and an official transcript on completion. UPI Study has helped over 130,000 students with college credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Compare: Principles of Marketing vs Marketing Research

Why take it here

Why students take Marketing Research with UPI Study

Turn customer questions into evidenceMarketing Research teaches how companies find out what customers want: defining the problem, interviews and focus groups, survey design and sampling, measurement scales, experiments, secondary and syndicated data, and data analysis from descriptive statistics to hypothesis tests, cross-tabs and regression, ending with the research report. It suits marketing and business degrees.
Credit at a fraction of the priceThe same 3 credits can cost $750 or more at a US college. Here it is one payment, self-paced, with lifetime access.
Finish your degree soonerTransfer credits reduce the courses you still owe, so you can graduate earlier or lighten a heavy semester.
Strengthen an applicationA completed college-level course on an official transcript shows admissions and scholarship committees you can do the work.
Study on your own scheduleNo start dates, no deadlines. Watch the lessons, practice, and take the final when you are ready.
130,000+students helped with college creditsACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Where the credit goes

Universities that work with NCCRS

Marketing Research carries a NCCRS credit recommendation. These universities work with NCCRS; some are UPI Study's signed partners. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Find my college → Not listed? Ask Athena in the corner of this page, or book a 15-minute call.

FAQ

Questions students ask us

About Creating Cross-Tabulations in Excel: Step-by-Step Process and Examples

How do you make a cross-tab with a PivotTable in Excel?
Click any cell in a tidy data list, choose Insert, then PivotTable, pick New Worksheet and click OK. In the fields pane, drag one variable to Rows and the other to Columns, then drag a text field into Values so Excel counts it. To see percentages, right-click a number, choose Show Values As, and pick a percent of the column, row or grand total.
How do you use COUNTIFS to build a cross-tab?
COUNTIFS counts rows where every condition is true, using pairs of a range and a value to match. For example, =COUNTIFS($B$2:$B$41,F$1,$C$2:$C$41,$E2) counts shoppers whose channel matches the header in row 1 and whose answer matches column E. The mixed references let one formula be copied across the whole table without drifting.
Why is my PivotTable not updating?
A PivotTable stores its own summary and does not recalculate when the source data change until you refresh it. Right-click inside the table and choose Refresh. A stale table can look perfectly normal, with neat totals, while describing data that no longer exist. For files others will keep editing, a COUNTIFS table that updates automatically is often safer.
Why does my PivotTable split one category into two?
Usually because the same answer is typed in different ways, such as corner in one row and corner store in another, or online followed by a hidden trailing space. Excel treats any difference in spelling or spacing as a different answer, so these become separate categories without any error message. Clean the data first: one row per respondent, no blank rows, no merged cells, and consistent spelling.

About the Marketing Research course

How many college credits is Marketing Research?
Marketing Research (Marketing 300) carries a NCCRS credit recommendation for 3 semester credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
How much does Marketing Research cost and what is included?
$250, paid once, with lifetime access: all 101 video lessons, a practice quiz after each, the graded work and final exam, and an official transcript when you finish. Students who want several courses choose UPI Study PRO instead.
Which universities accept UPI Study credits?
UPI Study has signed partner agreements with universities such as Thomas Edison State University, University of the People and Charter Oak State College, and works with universities such as Penn State, SNHU and SUNY. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities. Use "Find my college" on this page to check yours.
How long does Marketing Research take?
It is self-paced with no deadlines. The 101 lessons total about 19 hours of video; most students add reading and practice time and finish in a few weeks to a few months, on their own schedule.
How are the exams done?
Quizzes and assignments are online in the course. The final exam is taken online with proctoring; a person on the UPI Study team checks assignments, usually within two days.
How do my credits reach my college?
When the course shows 100% complete, request the official transcript from your dashboard. It is sent to the college you name, and you can send it to more than one. Check your college first with "Find my college" on this page, or ask Athena.

Ready for the full course? Earn 3 credits in Marketing Research.

101 video lessons, a quiz after each one, and the graded work that earns the credit. Recommended for credit by NCCRS.

Updated

Marketing Research
3 credits · NCCRS
Enroll →