How to Calculate Chi Square in Excel

If you just need to calculate chi square in excel and move on, the boxed answer at the top is all you need. The rest of this page is for when you want to understand why it works in Excel, adapt it to a trickier version, or make it robust enough to hand to a colleague. We keep the opening short on purpose — the depth is here when you want it, not in your way when you don’t.

Exact answer

In Excel: use =CHISQ.TEST(actual, expected) — it tests whether observed COUNTS differ from expected ones, which is the categorical counterpart to the t-test.

On this page8

Syntax

=CHISQ.TEST(actual_range, expected_range)

Arguments

Argumentrequired / optionalDescription
actual_rangerequiredThe observed counts.
expected_rangerequiredThe expected counts under the null hypothesis, the same shape.

Related functions

T.TESTFREQUENCYCOUNTIFS
ƒxFrequency TableLive
Distinct values
3

6 entries

ValueCountShare
Berlin350.0%
Munich233.3%
Hamburg116.7%
=COUNTIF($A$2:$A$100,D2) · =UNIQUE(A2:A100)
Ctrl+CthenCtrl+Shift+V+Cthen+Ctrl+VPaste values · WindowsMac

Need it as an auditable file?

Ships inside the linked template — formula-driven, unlocked, audit-ready.

View template

What this does

CHISQ.TEST compares observed counts against expected counts and returns the probability that the difference is chance. It is the test for categorical data — which channel converts better, whether responses are evenly spread across regions — where the t-test needs continuous measurements. The expected range must be computed, not guessed: for an independence test it is the row total times the column total divided by the grand total. The test becomes unreliable when any expected count falls below about five, which is the standard caveat and the reason small surveys often cannot use it. The same idea underpins a lot of everyday Excel work, so the few minutes spent getting it right here pay back across every sheet you build afterwards. Treat it as a pattern, not a one-off, and it stops being something you look up and starts being something you reach for. For “calculate chi square in excel”, the reliable version is a short checking loop, not just the first command that appears to work. Run it on a deliberately small range first, watch how the affected cells change, and only then apply the same setup to the full sheet. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. That is what makes a calculation you can defend to a CFO or an auditor useful in real work: repeatable, auditable, and not dependent on memory or luck.

A worked example

Conversions across three channels observed as 45, 62 and 38 against expected 48.3 each: =CHISQ.TEST(B2:B4, C2:C4) returning 0.08 says the differences are within chance at the 5 % level. Building the expected values for a contingency table: each cell is =row_total*column_total/grand_total. CHISQ.TEST is the significance test for categorical counts, which is most survey and channel data — and where a t-test does not apply at all. One habit worth forming early: name the cells that hold your inputs, so the formula reads in plain language instead of a string of cell addresses. A reviewer — or you in three months — can then follow the logic without decoding what B7 and D2 were supposed to mean, which is most of what makes a sheet maintainable.

In Google Sheets

Google Sheets handles this almost identically to Excel. The formula syntax above is the same, and the menu lives under a slightly different label rather than a ribbon tab. Use the platform toggle at the top of the page to switch every keyboard shortcut between Windows and Mac, and expect at most cosmetic differences in naming. Nothing on this page is behind a login: the tool runs entirely in your browser, the formula is shown in full with one-click copy, and the steps work the same on Windows and Mac. That is the whole promise here — the exact answer, a way to prove it on your own numbers, and just enough context to make it stick. The short version of “calculate chi square in excel”: the answer is at the top of this page, the tool proves it on your own numbers, and the sections above explain why it holds so the next variation does not stump you. Excel rewards people who reference cells instead of typing values and who keep inputs separate from formulas, because that is what makes a result you can audit months later. Build it once, deliberately, with the live tool as a check, and you convert a one-off lookup into a reusable skill — which is the whole point of learning the why and not just the what.

Common mistakes

  • Passing percentages or averages rather than raw counts, which the test is not defined for.
  • Using expected values that are guessed rather than computed from the marginal totals.
  • Applying it where an expected count is below five, where the approximation breaks down.

Frequently asked questions

When do I use chi-squared instead of a t-test?

When the data is counts in categories rather than continuous measurements.

How do I calculate the expected values?

For an independence test, each cell is its row total times its column total, divided by the grand total.

Why is my test unreliable?

Probably an expected count below five, where the chi-squared approximation stops holding.

Other ways people ask this

On the way here you may have searched this as “how do you calculate chi square in excel” and “how to calculate chi square test in excel” — it is all the same task, and this page is the single, complete answer to it.

Why do people search for this in so many different ways?

Because the same task has many names. “how do you calculate chi square in excel”, “how to calculate chi square test in excel” all point at the one operation explained on this page, which is why they all lead here.