If you're running an A/B test, comparing survey results, or checking whether a change in your data is real or just noise, you need a p-value. Excel doesn't have a single "P-value" button, but it has several built-in functions โ T.TEST, Z.TEST, CHISQ.TEST, and F.TEST โ that calculate one directly from your data, no manual statistics required.
This guide from Anchor AI Tools walks through which formula to use for which situation, gives you the exact syntax for each, and works through a real example from start to finish.
Quick Answer: To calculate a p-value in Excel, use the built-in test function that matches your data: =T.TEST(array1,array2,tails,type) to compare two sample means, =Z.TEST(array,x) to compare one sample against a known population mean, or =CHISQ.TEST(actual_range,expected_range) for categorical data. Each formula returns the p-value directly โ compare it to your significance level (commonly 0.05) to decide whether the result is statistically significant.
A p-value is the probability of seeing a result at least as extreme as the one in your data, assuming there is actually no real effect or difference (this assumption is called the null hypothesis). A small p-value means your result would be unlikely if nothing real were going on โ so you have evidence against the null hypothesis. A large p-value means your result is easily explained by random chance.
Most fields use 0.05 as the significance threshold: a p-value below 0.05 is typically labeled "statistically significant." That threshold is a convention, not a law of nature, so always consider it alongside sample size and effect size โ a point statisticians and organizations like the American Statistical Association emphasize when warning against treating 0.05 as a strict pass/fail line.
Excel calculates p-values through hypothesis-test functions rather than one universal formula. Pick the function that matches your data type and question:
| Function | What It Tests | Best For |
|---|---|---|
| T.TEST | Difference between two sample means | A/B tests, before/after comparisons, small samples |
| Z.TEST | One sample mean vs. a known population mean | Large samples with a known standard deviation |
| CHISQ.TEST | Association between categorical variables | Survey responses, contingency tables |
| F.TEST | Whether two samples have equal variance | Checking assumptions before running a t-test |
T.TEST is the formula most people mean when they search for "how to calculate p value in excel" โ it compares the means of two groups, such as conversion rates before and after a website change.
=T.TEST(array1, array2, tails, type)
tails: 1 (one-tailed) or 2 (two-tailed) ยท type: 1 (paired), 2 (equal variance), 3 (unequal variance)Use Z.TEST when you're comparing one sample to a known or hypothesized population mean โ for example, testing whether this month's average order value differs from a long-term historical average.
=Z.TEST(array, x, [sigma])
array = your sample ยท x = the population mean to test against ยท sigma = population standard deviation (optional)Important: Excel's Z.TEST returns a one-tailed p-value by default. For a two-tailed result โ which is what most people actually want โ wrap it like this:
Use CHISQ.TEST when your data is counts or categories rather than measurements โ for example, checking whether response rates differ across three marketing channels.
=CHISQ.TEST(actual_range, expected_range)
actual_range = your observed counts ยท expected_range = the counts you'd expect if there were no associationYou'll usually calculate the expected values yourself first (row total ร column total รท grand total for each cell) before referencing them in the formula.
F.TEST doesn't test means โ it tests whether two samples have equal variance. Run this first if you're unsure which type argument to use in T.TEST.
=F.TEST(array1, array2)
A result above 0.05 suggests the variances are roughly equal โ use type 2 in T.TESTA team runs an A/B test on a landing page. Group A (old page) and Group B (new page) each have 10 days of conversion-rate data.
| Day | Group A (Old) | Group B (New) |
|---|---|---|
| 1 | 4.1% | 5.0% |
| 2 | 3.8% | 4.6% |
| 3 | 4.4% | 5.3% |
| 4 | 3.9% | 4.9% |
| 5 | 4.2% | 5.1% |
| Avg | 4.08% | 4.98% |
๐ Formula Used
With Group A in A2:A6 and Group B in B2:B6:
Since 0.021 is below the standard 0.05 threshold, the difference between the old and new page's conversion rates is unlikely to be due to random chance โ the team has statistical evidence the new page performs better.
| P-Value Range | What It Suggests |
|---|---|
| p โค 0.01 | Very strong evidence against the null hypothesis |
| 0.01 < p โค 0.05 | Strong evidence โ commonly called "statistically significant" |
| 0.05 < p โค 0.10 | Weak or marginal evidence, often reported as a trend |
| p > 0.10 | Little to no evidence against the null hypothesis |
A p-value tells you how surprising your data would be if there were no real effect โ it does not tell you how large or important that effect is. Always look at the actual difference in numbers (like the 0.90-point conversion gap above) alongside the p-value.
Using the wrong "type" argument in T.TEST. Paired data (same subjects, two conditions) needs type 1. Two independent groups need type 2 or 3 depending on whether their variances are equal โ run F.TEST first to check.
Defaulting to one-tailed tests. Unless you have a specific directional hypothesis decided in advance, use a two-tailed test (tails = 2).
Treating p = 0.05 as an absolute cutoff. A p-value of 0.049 and 0.051 represent almost identical evidence. Report the actual value, not just "significant" or "not significant."
Mismatched range sizes. T.TEST with type 1 (paired) requires both arrays to be the same length, or Excel returns #N/A.
Confusing significance with importance. With a large enough sample, even a tiny, meaningless difference can produce a low p-value. Check the effect size, not just the p-value.
This comes up constantly for marketers running A/B and multivariate tests, students and researchers analyzing survey or experimental data, data analysts validating whether a trend is real, quality-control engineers comparing production batches, and small business owners testing pricing or messaging changes.
Working with other spreadsheet calculations? Check our guides on how to calculate median in Excel, how to calculate standard error in Excel, and how to calculate SEM in Excel.
Need more free calculators and formula guides?
Explore Free Tools โT.TEST for comparing two means, Z.TEST for one sample against a known mean, CHISQ.TEST for categorical data, or F.TEST for comparing variances.T.TEST, set the tails argument to 2, e.g. =T.TEST(A2:A11,B2:B11,2,3). For Z.TEST, which only returns a one-tailed value, use =2*MIN(Z.TEST(range,x),1-Z.TEST(range,x)).#N/A usually means your two arrays are different lengths while using a paired test (type 1) โ switch to type 2 or 3, or match the array sizes. #DIV/0! often means one of your ranges has zero variance (identical values).T.TEST, Z.TEST, CHISQ.TEST, and F.TEST with the same syntax as Excel, so every formula in this guide works there too.CORREL(), convert it to a t-statistic, then use =T.DIST.2T(t_stat, degrees_of_freedom) to get the p-value. This is a more advanced use case beyond the direct test functions covered here.Median in Excel
Find the middle value in any dataset.
Standard Error in Excel
Measure how precise your sample mean is.
SEM in Excel
Calculate standard error of the mean step by step.
Percentage Calculator
Calculate percentage increase, decrease, and discounts.
Time to Decimal Calculator
Convert hours and minutes to decimal for payroll.
SEO Audit Tool
Check your site's SEO health and AI visibility.
We build free, fast, and accurate online tools and guides that explain the answer โ not just show a number. Used by students, analysts, marketers, and small businesses every day.
Published by Anchor AI Tools ยท ยฉ 2026 Anchor AI Tools