Skip to main content

How to find a p-value in Excel

Excel will give you a correct p-value if you pick the right function and its arguments. Both parts of that sentence do work — here is the full set, with the arguments spelled out and the traps marked.

9 min read · Last reviewed 7 August 2026

Two routes, and which one you are on

Excel splits this into two families of function, and knowing which you need saves most of the confusion:

  • You have raw data in cells. Use a test function — T.TEST, CHISQ.TEST, F.TEST, Z.TEST. These go straight from ranges to a p-value, and never show you the test statistic.
  • You have a test statistic already. Use a distribution function — T.DIST.2T, NORM.S.DIST, CHISQ.DIST.RT, F.DIST.RT. These convert a statistic and its degrees of freedom into a tail area.

From raw data

TestFormula
Two independent groups =T.TEST(A2:A31, B2:B29, 2, 3)
Paired / before–after =T.TEST(A2:A31, B2:B31, 2, 1)
Contingency table =CHISQ.TEST(observed_range, expected_range)
Equality of two variances =F.TEST(A2:A31, B2:B29)
One sample, σ known =Z.TEST(A2:A31, 100, 15)

The two trailing arguments of T.TEST are where results go wrong. Tails is 1 or 2 — use 2 unless you committed to a direction in advance. Type is 1 for paired, 2 for two-sample assuming equal variances, and 3 for two-sample not assuming equal variances, which is Welch's test and the one you almost always want. Type 2 is the common default and the riskier choice: when the variances differ it returns a p-value that is too small.

CHISQ.TEST has its own catch. It wants observed and expected ranges, and it will not compute the expected counts for you — you have to build that second table yourself as row total × column total ÷ grand total. It also infers the degrees of freedom from the range shape, so a mis-shaped expected range silently changes df.

From a test statistic

You haveTwo-tailed pRight-tailed p
t and df =T.DIST.2T(ABS(t), df) =T.DIST.RT(t, df)
Z =2*(1-NORM.S.DIST(ABS(z), TRUE)) =1-NORM.S.DIST(z, TRUE)
χ² and df — =CHISQ.DIST.RT(x, df)
F, df₁, df₂ — =F.DIST.RT(f, df1, df2)
r and n =T.DIST.2T(ABS(r)*SQRT((n-2)/(1-r^2)), n-2) —

ABS() around the t is not optional: T.DIST.2T returns #NUM! for a negative argument, which surprises everyone once. Chi-square and F have no two-tailed entry because those tests are inherently right-tailed — doubling them is not conservative, it is meaningless.

For critical values rather than p-values, the inverse functions mirror these: T.INV.2T(alpha, df), NORM.S.INV(1-alpha), CHISQ.INV.RT(alpha, df) and F.INV.RT(alpha, df1, df2). Our critical value calculator does the same thing without the argument-order risk.

The Analysis ToolPak

For a full output table — statistic, df, p-value, critical value — rather than a single number, enable the Analysis ToolPak. On Windows it is File → Options → Add-ins → Manage Excel Add-ins → Go → tick Analysis ToolPak. On macOS it is Tools → Excel Add-ins. It then appears as Data → Data Analysis.

It covers t-tests, ANOVA, regression, correlation and F-tests, and it reports both the one-tailed and two-tailed p alongside their critical values. The catch worth knowing: its output is a static snapshot, not a formula. Change your data afterwards and the results do not update, which is a genuinely easy way to publish stale numbers.

Four mistakes Excel makes easy

  1. Reading p = 0.00 as zero. Excel computes a tiny p-value correctly and then displays it as 0.00 with default cell formatting. Set the cell to scientific notation and you will see something like 3.4E-09. A p-value is never exactly zero, and reporting one as zero is wrong.
  2. Leaving T.TEST on type 2. That assumes equal variances. Type 3 (Welch) costs almost nothing when they are equal and protects you when they are not. R has used Welch as its default for years.
  3. Using Z.TEST as if it were two-tailed. It returns the one-tailed probability. For a two-tailed answer use =2*MIN(Z.TEST(range, x), 1-Z.TEST(range, x)).
  4. Trusting a range with blanks or text. Excel skips non-numeric cells silently, so a stray "N/A" changes your n and therefore your p-value with no warning. Check the count with =COUNT(range) before believing the result.

The old function names — TTEST, CHITEST, TDIST, NORMSDIST, FDIST — still work for backward compatibility and are what most tutorials online show. They are not deprecated in the sense of being wrong, but TDIST takes a tails argument where T.DIST.RT and T.DIST.2T are explicit, and explicit is worth having here.

Google Sheets implements the same names with the same arguments, so everything above transfers unchanged.

Checking your answer

Excel gives you a number and no way to see whether it is the number you meant to compute. The quickest check is to run the same test somewhere that shows its working: paste your two columns into the t-test calculator, or drop your statistic and df into the p-value calculator, and compare. If they disagree, it is almost always a type or tails argument rather than an arithmetic difference.

You also get the things Excel does not print: the effect size, the confidence interval, and a plain-English reading of what the p-value supports.

Keep reading

Ready to run the numbers?

Our calculator shows the shaded distribution, the exact p-value, and a plain-English reading of what it supports.

Open the P-Value Calculator

Frequently asked questions

What is the formula for a p-value in Excel?

It depends on what you have. From two columns of raw data, =T.TEST(range1, range2, 2, 3) gives a two-tailed Welch p-value directly. From a t-statistic and its degrees of freedom, =T.DIST.2T(ABS(t), df). From a Z-score, =2*(1-NORM.S.DIST(ABS(z), TRUE)). From a chi-square statistic, =CHISQ.DIST.RT(x, df). From an F-statistic, =F.DIST.RT(f, df1, df2).

What do the last two arguments of T.TEST mean?

Tails is 1 or 2, and should be 2 unless you decided on a direction before collecting data. Type is 1 for a paired test, 2 for two independent samples assuming equal variances, and 3 for two independent samples not assuming equal variances. Type 3 is Welch's test and is the safer default — type 2 returns a p-value that is too small when the group variances differ.

Why does Excel show my p-value as 0?

Because of cell formatting, not the calculation. Excel computes small p-values correctly but displays them as 0.00 under the default number format. Change the cell to scientific notation, or add decimal places, and the real value appears. Never report p = 0 — a p-value is a probability that is only zero in the limit, and the correct report for a very small one is p < .001.

How do I get a p-value from a t-statistic in Excel?

Use =T.DIST.2T(ABS(t), df) for a two-tailed test or =T.DIST.RT(t, df) for a right-tailed one. The ABS() matters: T.DIST.2T returns a #NUM! error if you hand it a negative number, and t-statistics are frequently negative. For a left-tailed test use =T.DIST(t, df, TRUE).

Does Excel have a chi-square calculator?

CHISQ.TEST(observed, expected) returns the p-value, but it will not build the expected table for you — you have to compute row total × column total ÷ grand total for every cell yourself, and it infers the degrees of freedom from the range shape rather than telling you what it used. Our chi-square calculator takes the observed table alone and shows the expected counts it derived.

Do these formulas work in Google Sheets?

Yes. Google Sheets implements T.TEST, CHISQ.TEST, T.DIST.2T, NORM.S.DIST, CHISQ.DIST.RT and F.DIST.RT with the same names and the same argument order, so every formula here transfers unchanged.