Survey Crosstab
Operator: Abdulla Al Fahad. How tools are built and checked
A crosstab answers a plain question: do people who answered one way to question A tend to answer a certain way to question B? Do customers in the South rate support higher than customers in the North? Do under-30s prefer chat while over-60s phone in? The table that answers it has one question down the side, one across the top, and in every cell the number of respondents who gave that pair of answers.
This page builds those tables from a survey export you already have. Load the CSV or XLSX that Google Forms, SurveyMonkey, Typeform or a spreadsheet gave you, choose a row question and a column question, and the counts, the percentages and a significance test appear straight away. Nothing is sent anywhere; the file is read by the browser tab you are looking at.
It does the parts that make survey crosstabs awkward in a general spreadsheet: answers to a tick-all-that-apply question stored in one cell, a weight column from a post-stratified sample, a SurveyMonkey file with two header rows, and a rating scale that should read Strongly disagree to Strongly agree rather than in alphabetical order.
Key features
- One row question crossed with up to ten column questions at once, each producing its own table
- Counts, row percent, column percent, total percent, or counts with row percent in the same cell
- Multi-select answers split on comma, semicolon, pipe or new line, with a choice of respondents or responses as the percentage base
- Optional weight column with weighted counts and an effective sample size
- Chi-square test of independence with degrees of freedom and p-value, plus Cramér's V with a size label that adapts to the table's shape
- A low-expected-count warning, and a Fisher exact p-value for unweighted 2 by 2 tables
- Adjusted standardised residuals with cells beyond plus or minus 1.96 marked with arrows as well as colour
- Top N categories folded into Other, a No answer category, and known rating scales put in their natural order
- XLSX with a Summary sheet and one sheet per crosstab, and a CSV of whichever view is on screen
How respondents become cells: multi-select, weights and the chi-square test
Input is a .csv, .tsv or .xlsx file up to 25 MB, with the first row (or the first two rows, see below) as question names and one respondent per row after that. The first worksheet is read from an XLSX. CSV text is read as UTF-8 or UTF-16 and a byte-order mark is stripped. Files with more than 300,000 respondent rows are cut to the first 300,000, with a note about it. Every cell is handled as text, so an answer such as 07 or 3.0 stays exactly what the survey tool wrote.
Blank cells and the entries N/A, NA, null, a single dash and two dashes count as no answer. By default a respondent with no answer to either question in a pair is left out of that table, and the heading above the table reports how many were dropped. Switching on the No answer category keeps those respondents instead, as their own row or column, which is the right choice when skipping a question is itself interesting.
A multi-select question is one where a cell holds several answers, for example Email, Live chat. Mark it as comma, semicolon, pipe or new-line separated and each respondent is counted once in every option they ticked, never twice in the same option. When you pick a column the page looks at its values and pre-selects a separator if at least a fifth of the filled cells contain it and the pieces stay short. An answer option that itself contains a comma, such as Yes, definitely, will be split in two; use a semicolon-separated export or pick the single-answer setting for that question.
Weights come from a numeric column. Each respondent contributes their weight instead of 1, so the cells become weighted sums, shown to one decimal. A row whose weight is blank, text, zero or negative is left out and counted in the note under the table. The page also reports the effective sample size, the square of the weight total divided by the sum of squared weights, which tells you how much information the weighted sample really carries.
A SurveyMonkey export often puts the question text in row 1 and the option or response label in row 2, with empty header cells over the option columns. When the first row of data is mostly the word Response or Open-Ended Response, or when many header cells are blank, the page ticks a sub-header box for you and merges the two rows into names like Satisfaction - Very satisfied. You can untick it, or tick it yourself when the detection misses.
How it works
For each respondent the page gets a list of answers to the row question and a list for the column question. A single-answer question gives a list of one; a multi-select question gives one entry per ticked option. If either list is empty the respondent is skipped, otherwise the respondent's weight (1 when unweighted) is added to every combination of one row answer and one column answer. The row and column margins are the weight of respondents who ticked that option, so with multi-select they can add up to more than the number of respondents.
The chi-square statistic compares each cell with the count expected if the two questions were unrelated: row total times column total divided by the grand total. It sums (observed minus expected) squared over expected across all cells, with (rows minus 1) times (columns minus 1) degrees of freedom. The p-value is the upper tail of the chi-square distribution, computed with the regularised incomplete gamma function rather than a table. No continuity correction is applied to 2 by 2 tables, so the figure matches the plain Pearson statistic that most textbooks print.
Cramér's V is the square root of chi-square divided by n times the smaller of (rows minus 1) and (columns minus 1). It runs from 0 to 1 and does not grow just because the sample did. The labels follow Cohen's guide: for a table where the smaller dimension gives one degree of freedom, below 0.10 is negligible, up to 0.30 small, up to 0.50 medium, and larger is large; the cut-offs shrink to 0.07, 0.21 and 0.35 when it gives two, and 0.06, 0.17 and 0.29 from three upward.
With weights, the test is run on the weighted sums rescaled so that they add up to the number of unweighted answers. Without the rescale a weight that averaged 3 would triple chi-square and make everything look significant. The rescaling keeps the sample size honest but it is an approximation; a design-based test needs the survey's strata and clusters, which a flat export does not carry.
The Fisher exact p-value, for a 2 by 2 table of whole counts, sums the probability of every table with the same margins that is no more likely than the one observed. It is exact where chi-square is only an approximation, which is why it is offered when expected counts are low. Adjusted standardised residuals divide each cell's gap from expectation by its standard error; values beyond 1.96 flag cells that depart from independence at about the 5 percent level.
Common use cases
- A customer-satisfaction survey where you want to know whether ratings differ by region, plan or age band, and need a p-value to back the slide
- A student project that must report a chi-square test of independence and Cramér's V for two categorical survey items, with the expected-count assumption checked
- A tick-all-that-apply question (which channels did you use) crossed with a demographic, which a pivot table cannot do without first splitting the cell
- A weighted panel sample where every cell should be a weighted count and the sample size should be quoted after weighting
- Ten demographic breakdowns of the same headline question, exported as one workbook with a sheet each for a client report
How to use this tool
- Choose the survey file, or press Use sample survey to try a 160-respondent customer survey.
- If the second row of your file holds option labels, tick the sub-header box (it ticks itself when the layout is recognised).
- Pick the row question, then a column question. Add up to nine more column questions to run several crosstabs against the same row question.
- For each question set whether it is a single answer or a multi-select split on a given character; the page suggests one.
- Optionally choose a weight column, fold rare answers into Other with Top N, or keep No answer as a category.
- Read the counts and percentages, the test result and the warnings under each table, then download the XLSX or a CSV.
Example
Press Use sample survey, then cross Region (rows) with Satisfaction (columns); 160 respondents, 6 left out for a blank Satisfaction
Region x Satisfaction, counts
V.dissat Dissat Neutral Satisf V.satisf
East 1 11 14 16 4
South 0 3 7 14 16
North 2 15 14 7 2
West 0 2 4 10 12What the page reports for those 154 respondents
Chi-square 42.67 on 12 degrees of freedom
p-value 0.0000257
Cramér's V 0.304 (large for a 4 x 5 table)
Smallest expected count 0.55, 20% of cells under 5 -> warning shown
South x Very satisfied residual +3.18 (more than expected)
North x Dissatisfied residual +3.18 (more than expected)
North x Very satisfied residual -3.03 (fewer than expected)
With the Survey weight column switched on: chi-square 48.84, effective sample size 140.9Tips for best results
- Put the question you think of as the outcome in the columns and the grouping variable in the rows, then read row percent; each row then sums to 100 and answers the question 'of the people in this group, how many said what'.
- Look at the smallest expected count before you look at the p-value. A table with many empty corners is better collapsed, with Top N or by recoding in the source file, than reported as it stands.
- Use the residual table to say where the difference sits. A significant overall p-value only says that the two questions are related somewhere in the table.
- Switch to the responses base for multi-select questions when you want columns that add to 100 percent, and keep respondents when you want to say 'x percent of people used chat'.
- Keep the rating-scale ordering switch on; it only reorders when every category belongs to one known scale, so ordinary categories are left in your chosen order.
Common pitfalls
Chi-square assumes each respondent appears once. Multi-select tables put a respondent in several cells, so the p-value is shown with a caution and should be read as a rough guide, not a precise probability.
A significant result with a tiny Cramér's V is common in large samples. The test says the difference is unlikely to be chance, not that it is large; the V label tells you the size.
The test treats categories as unordered. For two ordered scales a trend test would be more powerful, and this page does not run one.
Rounding does not hide anything, but recoding does: a column with free-text answers will produce hundreds of one-person categories. The page warns above 30 distinct answers; fold them with Top N or clean the column first.
Weighted p-values here come from rescaled weighted counts. They stop weights from inflating significance, but they ignore the survey design, so do not quote them as design-adjusted figures.
Option text containing the separator is split wrongly. If your export uses commas inside answers, ask for a semicolon-separated export or one column per option.
Common errors and how to fix them
- The table is empty or says no respondent answered both questions
- The two questions were never answered by the same people, or one of them is blank for everyone. Check that you picked the right columns, or switch on the No answer category to keep respondents who skipped one question.
- A column question is the same as the row question
- Choose a different column for one of them. A question crossed with itself only fills the diagonal.
- Option names look split into fragments
- The question is marked as multi-select with a separator that also appears inside the answer text. Switch it to single answer, or use a separator that the answers do not contain.
Best practices
- State the base in the table note: how many respondents answered both questions, and whether percentages use respondents or responses.
- Report the test with its degrees of freedom, for example chi-square(12) = 42.67, p < 0.001, V = 0.30, and mention if the expected-count warning appeared.
- Decide on handling of No answer before you look at results, not after, so the choice does not follow the data.
- Check the sample survey once against your own hand calculation of a 2 by 2 table to confirm you are reading the output the way it is meant.
What the XLSX contains
The Summary sheet lists every crosstab with its respondent count, chi-square, degrees of freedom, p-value, Cramér's V, size label and any warnings, so ten crosstabs can be skimmed on one screen. Each crosstab then has its own sheet, named by number and question text and cut to Excel's 31-character limit with illegal characters removed.
A crosstab sheet stacks four tables, counts, row percent, column percent and total percent, each with its margins, followed by the test block and the residual table. Residuals beyond 1.96 are shaded amber above expectation and blue below, and the numbers are written as real cell values so they can be sorted or referenced. Percent cells carry a percent number format, so they stay numbers rather than text.
Choosing between chi-square and Fisher exact
Chi-square is an approximation that works when expected counts are not too small. A common rule is that no more than a fifth of the cells should expect fewer than five and none should expect fewer than one. The page applies that rule to every table and prints the smallest expected count either way.
For a 2 by 2 table of whole counts the Fisher exact test needs no such rule. When the warning fires on such a table the Fisher figure is labelled as the one to use. For larger tables there is no exact test here; combine categories until the expected counts clear the thresholds, or report the result with its caveat.
Frequently asked questions
Does the file leave my computer?
No. The file is read and tabulated by your browser tab, and nothing is uploaded. Closing the tab discards it.
Why does a column add up to more than 100 percent?
With a multi-select question and the respondents base, a person who ticked three options counts in three cells. Switch the percent base to responses if you want each row or column to add to 100 percent.
Why is the p-value shown with a warning?
Either many cells expected fewer than five answers, or one of the questions is multi-select so the same respondent sits in several cells. Both break an assumption of the chi-square test.
Are my weights used in the significance test?
They are, after being rescaled so the weighted counts add up to the unweighted number of answers. That stops large weights from manufacturing significance, but it is not a design-based survey test.