How to Run a Chi-Square Test in Excel (CHISQ.TEST + Examples) 2026
Run a chi-square test in Excel using CHISQ.TEST and CHITEST. Step-by-step with contingency tables, expected values, p-values, df and CHISQ.INV.RT.

Chi-square in Excel sounds intimidating until you actually do it. Then it clicks. You're comparing two categorical variables — survey responses by age group, click rates by source, defect counts by shift — and you want to know if the pattern is real or just noise. Excel has two functions for this: the newer CHISQ.TEST and the legacy CHITEST. Both return a p-value. That's the number that tells you whether your data is hiding a relationship or just sitting there being random. Practice with the free Excel practice test on PracticeTestGeeks (500+ questions with answer explanations).
Here's the thing nobody mentions when they first show you the formula. Chi-square does not give you a chi-square statistic in Excel. Not directly. CHISQ.TEST jumps straight to the p-value. Which is fine — that's usually what you want — but if your professor or boss asks for the actual chi-square value, you'll need CHISQ.INV.RT or a manual sum across cells. We'll cover both paths.
This guide walks through the whole thing. Building a contingency table from raw data. Calculating expected frequencies using row and column totals. Plugging the ranges into CHISQ.TEST. Reading the p-value. And — the part most tutorials skip — knowing when chi-square is the wrong tool and you should be running something else entirely. By the end you'll be able to do this in any spreadsheet, on any version of Excel from 2010 forward, without looking it up again.
Microsoft Excel: upcoming dates and official changes
- Jun 30, 2026: Certiport retired the Microsoft Office Specialist 2016 certifications, including MOS Excel 2016, on June 30, 2026. The Microsoft 365 Apps and Office 2019 Excel exams are still available. (certiport.pearsonvue.com)
- Updated Oct 16, 2026: Delivery is now Proctored live-in-the-application exam via Certiport Authorized Testing Centers (in-center or remote-proctored) (previously Proctored live-in-the-application exam via Certiport Authorized Testing Centers).
- Updated Oct 16, 2026: Eligibility is now No formal prerequisites; about 150 hours of instruction and hands-on experience recommended (previously No formal prerequisites; ~150 hours of instruction and hands-on experience recommended (Associate)).
- Updated Oct 16, 2026: Time limit is now 50 minutes (60 minutes seat time) (previously 50 minutes (60 minutes seat time)).
Facts verified Oct 17, 2026 against Microsoft (Microsoft Office Specialist program), delivered by Certiport, a Pearson VUE business. Dates that have passed are removed automatically.
- The MOS Excel (Microsoft 365 Apps) exam has 33 to 37 questions. (certiport.pearsonvue.com)
- The MOS Excel Expert (Microsoft 365 Apps) exam has 23 to 27 questions. (certiport.pearsonvue.com)
- Microsoft Office Specialist Excel exams last 50 minutes, with 60 minutes of total seat time. (Microsoft (Microsoft Office Specialist program), delivered by Certiport, a Pearson VUE business)
- The passing score for Microsoft Office Specialist Excel exams is always 700 on Certiport's 1 to 1000 scaled score. (certiport.pearsonvue.com)
- After failing a Microsoft Office Specialist Excel exam, candidates must wait 24 hours before the first retake and 48 hours before each later retake, and there is no annual limit on attempts. (Microsoft (Microsoft Office Specialist program), delivered by Certiport, a Pearson VUE business)
- Microsoft Office Specialist Excel certifications earned on or after September 23, 2025 are valid for five years; those earned earlier do not expire. (certiport.pearsonvue.com)
- The Microsoft Office Specialist Excel exam is proctored and delivered live in the Excel application through Certiport Authorized Testing Centers, either in person or remote-proctored. (Microsoft (Microsoft Office Specialist program), delivered by Certiport, a Pearson VUE business)
- Microsoft recommends that candidates for the MOS Excel Associate (Microsoft 365 Apps) certification have about 150 hours of instruction and hands-on experience with Excel. (Microsoft (Microsoft Office Specialist program), delivered by Certiport, a Pearson VUE business)
- Candidates get their MOS Excel score report as soon as they finish the exam, and it can also be viewed in their Certiport profile. (certiport.pearsonvue.com)
Facts verified Oct 17, 2026 against Microsoft (Microsoft Office Specialist program), delivered by Certiport, a Pearson VUE business. Dates that have passed are removed automatically.
Microsoft Excel Exam at a Glance
| Item | Detail | Official source |
|---|---|---|
| Number of questions (Excel Associate (MO-210)) | 33-37 questions | certiport.pearsonvue.com |
| Number of questions (Excel Expert (MO-211)) | 23-27 questions | certiport.pearsonvue.com |
| Time limit | 50 minutes (60 minutes seat time) | Microsoft (Microsoft Office Specialist program), delivered by Certiport, a Pearson VUE business |
| Passing score | 700 on a 1–1000 scale | certiport.pearsonvue.com |
| Retake policy | Wait 24h after 1st fail, 48h before each later retake; no annual limit | Microsoft (Microsoft Office Specialist program), delivered by Certiport, a Pearson VUE business |
| Validity | Valid 5 years (earned on/after Sept 23, 2025) | certiport.pearsonvue.com |
| Delivery | Proctored live-in-the-application exam via Certiport Authorized Testing Centers (in-center or remote-proctored) | Microsoft (Microsoft Office Specialist program), delivered by Certiport, a Pearson VUE business |
| Eligibility | No formal prerequisites; about 150 hours of instruction and hands-on experience recommended | Microsoft (Microsoft Office Specialist program), delivered by Certiport, a Pearson VUE business |
| Score release | Score report at end of exam; also in Certiport profile | certiport.pearsonvue.com |
Facts verified Oct 17, 2026 against Microsoft (Microsoft Office Specialist program), delivered by Certiport, a Pearson VUE business. Dates that have passed are removed automatically.
Free Excel Study Tools
Interactive Excel resources on PracticeTestGeeks, free to start:
- Free Excel Questions and Answers — 16 questions with instant scoring and answer explanations
- Excel flashcards — review key terms and concepts card by card
- Excel study guide — topic-by-topic overview of what the exam covers
- Excel cheat sheet — one-page printable summary for last-minute review

Chi-Square in Excel at a Glance
Before we touch any formula, get the data shape right. Chi-square tests independence between two categorical variables. That means you need a contingency table — rows are one variable's categories, columns are the other's, and each cell holds the observed count. Not percentages. Not averages. Counts. If you've got percentages, multiply them back to raw frequencies first or the math breaks.
Quick example. You surveyed 200 people: 100 men and 100 women. You asked if they prefer coffee, tea, or neither. That gives you a 2×3 grid — two rows for gender, three columns for drink preference. Each cell is the number of people who fall into that combination. Add row totals on the right. Add column totals at the bottom. The grand total in the corner should equal your sample size. If it doesn't, you've miscounted somewhere.
The reason this layout matters is that Excel's CHISQ.TEST needs two ranges: observed (your actual counts) and expected (what you'd see if the variables were independent). The expected range has the same dimensions as the observed range. You compute it cell by cell using a simple formula we'll get to next.
The Contingency Table Rule
Chi-square needs raw counts, not percentages, averages, or rates. If your data is in percentage form, multiply back to integer counts using your sample size before running the test. Excel's CHISQ.TEST will accept decimals without warning — and silently return a wrong answer. Always verify the grand total in your contingency table equals your true sample size.
Expected frequencies are the bridge between raw data and the chi-square result. The formula for each cell is straightforward — multiply the row total by the column total, then divide by the grand total. That's it. In Excel, if your row total for "Men" is in D2 and your column total for "Coffee" is in B5 and your grand total is in D5, the expected value for the Men/Coffee cell is =D2*B5/D5. Lock those references with dollar signs so you can drag the formula across the whole expected table without breaking it.
One catch. Every expected cell needs to be at least 5 for the chi-square approximation to hold. If any expected value drops below 5, the test gets unreliable. You've got two options at that point — combine sparse categories until each expected count clears 5, or switch to Fisher's exact test (which Excel can't do natively, but R, Python, or even some online calculators handle it fine). Don't ignore this. People do, and it's the most common reason chi-square results get challenged in peer review.
The Four-Step Chi-Square Workflow
Lay raw counts in a grid. Rows = one variable's categories, columns = the other's. Add row totals, column totals, and the grand total.
Same shape as observed. Each cell = (row total × column total) / grand total. Use absolute references when dragging.
Type =CHISQ.TEST(observed_range, expected_range). Excel returns the p-value directly. No intermediate steps.
p < 0.05 means reject the null — the variables are related. p ≥ 0.05 means no significant evidence of dependence.

With observed and expected tables built, the actual test is one cell. Type =CHISQ.TEST(observed_range, expected_range) and hit enter. Excel returns the p-value. If it's below 0.05, you reject the null hypothesis — the two variables are not independent, there's a real association. Above 0.05 and you don't have enough evidence to claim a relationship. That's the entire test.
CHITEST is the older version of the same function. Identical syntax, identical output. Microsoft kept it around for backward compatibility with files made before Excel 2010. If you open a legacy workbook and see CHITEST, leave it alone — it still works. For new files, use CHISQ.TEST. The dot in the name is Excel's signal that this is the current, supported version.
Neither function gives you the chi-square statistic itself. Just the p-value. To get the actual statistic, you need to sum (observed - expected)² / expected across every cell. Use SUMPRODUCT for an elegant one-liner: =SUMPRODUCT((observed-expected)^2/expected). That gives you the chi-square value, which you can then check against a critical value from CHISQ.INV.RT.
Excel Functions You'll Use
The modern function, available in Excel 2010 and later. Syntax: =CHISQ.TEST(actual_range, expected_range). Both ranges must be the same size. Returns the p-value. Use this in all new workbooks.
Degrees of freedom for chi-square independence is (rows − 1) × (columns − 1). For our 2×3 gender/drink example that's (2−1) × (3−1) = 2. You need this number to find the critical value. In Excel, =CHISQ.INV.RT(0.05, 2) returns roughly 5.99. If your computed chi-square statistic exceeds 5.99, the result is significant at the 5% level — same conclusion you'd reach from CHISQ.TEST's p-value being under 0.05. Both paths land in the same place; pick whichever your audience expects to see.
Some statistics courses still teach Yates' continuity correction for 2×2 tables. The correction subtracts 0.5 from the absolute difference between observed and expected before squaring. Excel does not apply Yates automatically and offers no built-in function for it. If you need Yates, build a helper column with =(ABS(observed-expected)-0.5)^2/expected and sum it manually. Most modern statisticians have stopped using Yates because it's overly conservative — but if your assignment requires it, you now know how.
If any cell in your expected table is below 5, the chi-square approximation breaks down and results become unreliable. Two fixes: combine sparse categories (merge "Strongly Agree" and "Agree" if either is thin), or switch to Fisher's exact test for small 2×2 tables. Excel can't run Fisher natively — use R, Python's scipy, or a dedicated calculator. Never publish chi-square results without checking this assumption first.
Let's run a complete worked example. Imagine a small business tracked customer feedback across three store locations. They want to know if satisfaction (Satisfied / Neutral / Dissatisfied) depends on which store the customer visited. Here's the observed data laid out in cells B2:D4, with row labels in A2:A4 and column labels in B1:D1.
Store A had 50 satisfied, 20 neutral, 10 dissatisfied. Store B had 40, 30, 20. Store C had 30, 25, 25. Sum the rows in column E. Sum the columns in row 5. The grand total — 250 — goes in E5. Build the expected table in B7:D9 using the formula pattern above, anchoring row and column totals with $. Run =CHISQ.TEST(B2:D4, B7:D9) in any empty cell.
Excel returns approximately 0.0067. That's well below 0.05, so you'd conclude satisfaction is not independent of store — something about Store A's experience is different from B and C, and it's worth digging in.
Want the chi-square statistic too? =SUMPRODUCT((B2:D4-B7:D9)^2/B7:D9) gives roughly 14.16. Degrees of freedom is (3−1)×(3−1) = 4. The critical value from =CHISQ.INV.RT(0.05, 4) is about 9.49. Our 14.16 clears it easily — significant.

Chi-Square Excel Workflow Checklist
- ✓Confirm both variables are categorical, not continuous
- ✓Build the observed contingency table with raw counts only
- ✓Verify the grand total matches your sample size
- ✓Compute expected values: (row total × column total) / grand total
- ✓Check every expected cell is at least 5
- ✓Run =CHISQ.TEST(observed, expected) for the p-value
- ✓Calculate df as (rows-1)*(cols-1)
- ✓Use SUMPRODUCT for the chi-square statistic if reporting
- ✓Compare p against 0.05 (or your chosen alpha)
- ✓Report χ², df, sample size, and p-value together
People confuse chi-square with other tests all the time. Here's the rule. Use chi-square when both variables are categorical — labels, not numbers. Gender, color, brand, yes/no. If one variable is continuous (age in years, income in dollars, score out of 100), chi-square is the wrong tool. You'd use a t-test, ANOVA, or regression instead, depending on the shape of your question.
There are two distinct chi-square tests, by the way. The one we've been doing is the test of independence — two variables, one sample, asking whether they're related. The other is the goodness-of-fit test, which compares observed counts against a single theoretical distribution (like checking if a die is fair). Same formula behind the scenes; different question being asked. Excel handles both with CHISQ.TEST as long as you build the expected values correctly for each case.
Excel Pros and Cons for Chi-Square
- +Built into every Excel version since 2010 — no add-ins needed
- +CHISQ.TEST returns the p-value in one step
- +Works for any size contingency table, not just 2×2
- +Pairs cleanly with PivotTables for cross-tab analysis
- +Same logic as R and Python implementations — transferable skill
- −Doesn't return the chi-square statistic directly — requires SUMPRODUCT
- −No native Yates correction or Fisher's exact test
- −Silently accepts bad inputs (decimals, percentages) without warning
- −Expected-count assumption isn't enforced by Excel
- −PivotTable references sometimes need to be pasted as values first
Pros and Cons at a Glance
| Pros | Cons |
|---|---|
| CHISQ.TEST returns the p-value in one step | Doesn't return the chi-square statistic directly — requires SUMPRODUCT |
| Pairs cleanly with PivotTables for cross-tab analysis | No native Yates correction or Fisher's exact test |
| Same logic as R and Python implementations — transferable skill | Silently accepts bad inputs (decimals, percentages) without warning |
Errors creep in when people skip the data-cleaning step. Sort your raw data first. Make sure categories are spelled consistently — "Coffee" and "coffee" and "COFFEE" will be counted separately by PivotTables, which inflates your row count and skews the expected values. Use Excel's Find & Replace or the PROPER() function to standardize text before building the contingency table. Five minutes here saves you from a wrong answer later.
If your data is in long format — one row per respondent — use a PivotTable to build the contingency table in seconds. Drag one variable to Rows, the other to Columns, and any field to Values (set to Count). Excel does the cross-tabulation for you. Copy the PivotTable's values into a static range before running CHISQ.TEST, because the function doesn't always like PivotTable references directly.
A few advanced moves are worth knowing. For larger tables, build the expected matrix once and reuse it for multiple tests by changing only the observed range. If you're running chi-square across dozens of comparisons, write a small VBA function that wraps CHISQ.TEST and CHISQ.INV.RT together, returning both the p-value and the decision (significant / not significant) in one shot. Saves time on bulk analysis.
Reporting the result follows the same conventions as any published statistic. Quote the chi-square value, degrees of freedom, sample size, and p-value: χ²(4, N = 250) = 14.16, p = .007. Excel's CHISQ.TEST gives you the p-value directly; the chi-square statistic comes from your SUMPRODUCT cell; df you computed from the table dimensions; N is your grand total. Four numbers, every report.
Chi-square gets a lot of mileage in marketing, healthcare, education, manufacturing — anywhere you've got categorical outcomes and want to know if a treatment or segment makes a real difference. Excel makes it fast enough that there's no excuse to skip the test, eyeball the data, and call it a day. Two minutes of formula setup tells you whether the pattern you're seeing in the numbers is genuine or just chance.
One last note. Statistical significance is not the same as practical significance. A p-value of 0.001 with a tiny effect size in a sample of ten thousand might be statistically real but practically useless. Always pair chi-square with an effect-size measure — Cramér's V is the standard for tables larger than 2×2 — and a glance at the actual cell percentages to see what's driving the result. Excel will give you the math. You bring the judgment.
If you're new to Excel functions, the workflow above probably feels like a lot of steps. It gets faster. After two or three tests you'll have a template — observed table on top, expected table below, formulas pre-built — that you just paste new data into. Most analysts keep a single workbook with chi-square, t-test, and ANOVA templates ready to go. Build yours now. Future-you will thank present-you.
And if Excel ever starts feeling cramped — large datasets, lots of conditions, automation — the same logic ports cleanly to Python's scipy.stats.chi2_contingency or R's chisq.test(). The underlying statistic is identical. Excel is just one interface to the test. Get the concept right here and you can move to any tool when you outgrow the spreadsheet.
Pulling it all together — chi-square in Excel is three moves. Build the contingency table with raw counts. Compute expected values from row and column totals. Run CHISQ.TEST against the two ranges. The p-value tells you whether the variables are independent. CHISQ.INV.RT gives you the critical value if your professor wants the classical test. SUMPRODUCT recovers the chi-square statistic itself for reporting. Check expected counts ≥ 5, use Yates for small 2×2 tables if required, and remember chi-square only works for categorical data.
Where Chi-Square Earns Its Keep
The functions haven't changed since Excel 2010, so anything you learn here works in every modern version including Excel for Mac, Excel Online, and Microsoft 365. The only difference between versions is the function name — older files use CHITEST, newer ones use CHISQ.TEST. Both return the same p-value from identical inputs. You're set.
Common follow-up question: what alpha should you use? The default of 0.05 (5% significance) is convention, not law. For exploratory work some analysts loosen to 0.10. For high-stakes decisions — clinical trials, regulatory filings — 0.01 is standard. Whatever you pick, declare it before running the test, not after seeing the p-value. Adjusting your alpha to match the result you wanted is called p-hacking and it'll get your paper retracted.
One more practical tip. If you're comparing many groups in a single dashboard — say chi-square across twenty different product categories — the chance of getting a false positive somewhere climbs fast. The Bonferroni correction is the easy fix: divide your alpha by the number of comparisons. Running twenty chi-square tests at the usual 0.05? Your effective threshold per test becomes 0.0025. Brutal but honest. Excel doesn't do this adjustment for you — you keep it in your head or note it in a hidden column.
Worth knowing the limits too. Chi-square treats every cell as independent — no nesting, no clustering, no repeated measures from the same person. If your data has structure (multiple responses per respondent, students within classes, etc.) chi-square will overstate significance. You'd want a mixed-effects logistic regression instead, which is well outside Excel territory. For genuinely independent observations across categorical variables, though, Excel's chi-square is solid and gets the job done.
Last thing — keep your raw data. Always. Even after you've built the contingency table and run the test, the underlying response-level data is what you go back to when reviewers ask questions or when you want to slice the analysis differently. Save the raw sheet, the contingency table, and the chi-square output as three separate tabs in the same workbook. Future you, or whoever inherits the file, will be able to reproduce or extend the work without guessing what you did.
Sample Excel Practice Questions
Try these questions from our free Excel practice tests. The correct answer and an explanation follow each question.
Which Excel feature automatically fills a column by detecting a pattern from examples you type, such as extracting first names?
- A. AutoSum
- B. Flash Fill
- C. Goal Seek
- D. Data Validation
Answer: B. Flash Fill
Flash Fill recognizes patterns and completes the column with Ctrl+E.
Which Excel tool allows you to test multiple input values and see their effect on formula results simultaneously?
- A. Data Table
- B. Goal Seek
- C. Scenario Manager
- D. Solver
Answer: A. Data Table
Data Tables allow you to substitute multiple input values into formulas and display all results in a table format.
How do you manage External Links to other workbooks?
- A. Not tracked
- B. Data > Edit Links shows all external references with update, change, break options
- C. File > Properties
- D. Manage themselves
Answer: B. Data > Edit Links shows all external references with update, change, break options
Edit Links displays all external references with options to update, change source, or break links.
What does Resize Table do?
- A. Changes font size
- B. Adjusts table boundaries to include more or fewer rows/columns
- C. Changes column widths proportionally
- D. Scales for printing
Answer: B. Adjusts table boundaries to include more or fewer rows/columns
Resize Table modifies the table range to include or exclude rows and columns.
Take the full Excel practice test
Excel Questions and Answers
Written and edited by Nathan Beja, founder of Practice Test Geeks, with AI assistance. Exam facts are checked against the official sources linked below. Editorial policy
Sources & references
Exam facts on this page (fees, format, dates, passing scores) are checked against these official sources; the date is our last check. Editorial policy
- learn.microsoft.com — Retake policy, test delivery, time limit, eligibility · verified Oct 2026
- certiport.pearsonvue.com — Exam format, score validity, passing score, score release, exam information · verified Oct 2026