Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

CHISQ.DIST in Google Sheets: How to Use It

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

CHISQ.DIST returns the left-tailed probability of the chi-squared distribution for a given value, degrees of freedom, and a flag that switches between the cumulative distribution and the probability density. You use it when you have a chi-squared statistic and want to know how likely a value at least that large would be under the null hypothesis — the basis of chi-squared goodness-of-fit and independence tests. The syntax is =CHISQ.DIST(x, degrees_freedom, cumulative), where x is the chi-squared value (must be zero or greater), degrees_freedom is a positive whole number, and cumulative is TRUE for the cumulative probability or FALSE for the density at that point. For most hypothesis testing you want TRUE.

What You'll Need

  • A Google account with access to Google Sheets (the function works in the browser version and the mobile apps).
  • A chi-squared test statistic, or the raw counts you will use to calculate one.
  • The degrees of freedom for your test — for a goodness-of-fit test that is categories minus one; for an independence test on a contingency table it is (rows − 1) × (columns − 1).
  • Optional but useful: your observed and expected values laid out in separate ranges so you can compute the statistic with a formula rather than by hand.

Step-by-Step

  1. Open your spreadsheet and click the cell where you want the result to appear.
  2. Type =CHISQ.DIST( to start the formula. Sheets will show a tooltip with the argument order as you type.
  3. Enter the chi-squared value as the first argument. This can be a number typed directly, a cell reference such as B2, or an expression. It must be zero or positive; a negative value returns an error.
  4. Type a comma and enter the degrees of freedom as the second argument. This must be a positive integer. If you pass a decimal, Sheets truncates it to an integer.
  5. Type a comma and enter the third argument: TRUE for the cumulative distribution (the probability that a chi-squared variable is less than or equal to your value) or FALSE for the probability density at that exact point. Use TRUE for p-value style work.
  6. Close the parenthesis and press Enter. The cell shows the probability between 0 and 1.
  7. To turn a cumulative result into a right-tail p-value — the number you compare against a significance level — subtract it from 1: =1-CHISQ.DIST(B2, B3, TRUE). This is the probability of seeing a statistic at least as extreme as yours.
  8. If you would rather skip the subtraction, use the companion function =CHISQ.DIST.RT(x, degrees_freedom), which returns the right-tail probability directly and takes only two arguments.
  9. Format the result cell as a number with several decimal places (Format > Number > Number, or the decimal increase button in the toolbar) so small probabilities are readable.
  10. Copy the formula down a column if you are comparing several statistics, using absolute references (for example $B$3) for the degrees of freedom so it does not shift.

Common Mistakes

  • Using the wrong tail. CHISQ.DIST with TRUE gives the left-tail probability. A chi-squared test almost always needs the right tail, so either subtract from 1 or use CHISQ.DIST.RT. Reporting the left-tail value as your p-value will make significant results look insignificant.
  • Reversing the arguments. The value comes first and the degrees of freedom second. Swapping them produces a plausible-looking but wrong number rather than an obvious error.
  • Passing text for the cumulative flag. Use the logical values TRUE or FALSE, not the words in quotes. "TRUE" as text may be coerced in some cases but is unreliable; keep it unquoted.
  • Wrong degrees of freedom. For a contingency table, forgetting to subtract one from both rows and columns is the most frequent slip. Recheck the formula (rows − 1) × (columns − 1).
  • Expecting a p-value from FALSE. The density is a height on the curve, not a probability of an outcome, and it can exceed 1 for small degrees of freedom. It is not a p-value.
  • Using a statistic computed from percentages instead of counts. The chi-squared statistic assumes raw frequencies. Percentages distort it and the resulting probability is meaningless.

Tips

  • Build the statistic in a helper cell with =SUM((observed_range-expected_range)^2/expected_range) entered as an array formula (Ctrl+Shift+Enter, or Cmd+Shift+Enter on Mac), so the value feeding CHISQ.DIST updates automatically when data changes.
  • Pair the function with CHISQ.INV or CHISQ.INV.RT to find the critical value for a chosen significance level and compare it against your statistic — the two approaches give the same conclusion.
  • Name your degrees-of-freedom cell (Data > Named ranges) so formulas read clearly, for example =CHISQ.DIST.RT(stat, df).
  • Keep expected counts reasonably large. A common rule of thumb is that expected frequencies should be at least 5; below that the chi-squared approximation becomes unreliable and an exact test is more appropriate.
  • Remember the function is available in both Excel and Sheets with the same argument order, so formulas transfer between the two with little adjustment.

Troubleshooting

  • #NUM! error. Either the x value is negative or the degrees of freedom is zero or negative. Check both inputs; degrees of freedom must be at least 1.
  • #VALUE! error. One argument is text that cannot be read as a number, or the cumulative flag is malformed. Confirm the cell referenced actually holds a number and not a number stored as text.
  • Result looks far too small or too large. You are almost certainly looking at the wrong tail. Compare CHISQ.DIST(x, df, TRUE) with CHISQ.DIST.RT(x, df); they should sum to 1.
  • Formula copied down gives identical answers. The degrees-of-freedom reference shifted with the fill. Anchor it with dollar signs.
  • Unexpected decimals in degrees of freedom. Sheets truncates rather than rounds, so 4.9 becomes 4. Round explicitly with ROUND if that matters.
  • Nothing recalculates. Check File > Settings > Calculation if iterative calculation or manual recalculation has been enabled, and press Ctrl+Shift+F9 to force a full recalculation.

Frequently Asked Questions

What is the difference between CHISQ.DIST and CHISQ.DIST.RT?

CHISQ.DIST takes three arguments and returns either the left-tail cumulative probability or the density depending on the flag. CHISQ.DIST.RT takes two arguments and always returns the right-tail probability, which is what you normally want as a p-value.

Does CHISQ.DIST work the same in Excel?

Yes. The argument order and behaviour match, so a formula written in Sheets will work in Excel and vice versa. Older Excel versions used CHIDIST for the right tail, which is still supported for compatibility.

Can I use CHISQ.DIST for a test of independence?

Yes, provided you first compute the chi-squared statistic from your contingency table counts and supply degrees of freedom as (rows − 1) × (columns − 1). The function only converts a statistic to a probability; it does not build the table for you.

Why does the density result exceed 1 when cumulative is FALSE?

Because it is a probability density, not a probability. Densities describe the height of the curve and can be greater than 1, especially with one or two degrees of freedom. Only the cumulative form gives a value between 0 and 1.

What happens if I enter a negative chi-squared value?

You get a #NUM! error. Chi-squared values are sums of squared differences, so they cannot be negative; a negative input usually means a sign error in your helper formula.

Is there a limit on the degrees of freedom?

It must be a positive integer. Very large values are accepted but the calculation becomes numerically demanding; in practice most tests use small degrees of freedom tied to the number of categories or table size.