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
| Test | Formula |
|---|---|
| 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 have | Two-tailed p | Right-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
-
Reading
p = 0.00as 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. -
Leaving
T.TESTon 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. -
Using
Z.TESTas 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)). -
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.