ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Math
  3. How to Do a T-Test in Excel and Read the P-Value

How to Do a T-Test in Excel and Read the P-Value

By ExcelReady Team·Updated November 3, 2026·6 min read

The short answer

To do a t-test in Excel, type =T.TEST(array1, array2, tails, type), for example =T.TEST(B2:B8,C2:C8,2,3). Use 2 tails unless you fixed the direction in advance, and type 1 for paired data, 2 for equal variances or 3 for unequal variances. The result is the p-value: below 0.05 usually counts as statistically significant.

Key takeaways

  • T.TEST returns a p-value, not the t statistic; the Analysis ToolPak shows both.
  • Use type 1 for paired data (the same people measured twice) and type 3 for two separate groups when unsure.
  • Use two tails unless you chose one direction before you saw the data.
  • A p-value is how surprising your difference would be if the true averages were equal. It is not the chance the result is a fluke.
  • Always report the averages and their difference next to the p-value.
On this page+
  1. What does a t-test tell you?
  2. How to use the T.TEST function
  3. How to choose the tails and type
  4. How to read the p-value correctly
  5. How to run a t-test with the Analysis ToolPak
  6. Check your data before you trust the result
  7. Practise it

A t-test in Excel tells you whether the difference between two averages is bigger than you'd expect from random variation alone. You can run one with a single formula, T.TEST, or with the Analysis ToolPak, and both give you a p-value. This guide shows both methods on one small example, explains how to choose the tails and type, and shows how to read the p-value without overstating it.

What does a t-test tell you?#

A t-test compares the averages of two sets of numbers and asks: if there were really no difference between the groups, how unusual would a gap this big be? The answer comes as a p-value, a number between 0 and 1. A small p-value means the gap would be unusual if the groups were truly the same.

Here is the example used throughout. Seven learners were taught with Method A and seven different learners with Method B, then all took the same quiz:

ABC
1LearnerMethod AMethod B
216874
327279
437572
547081
656677
767476
877180

Start with the plain numbers. =AVERAGE(B2:B8) gives 70.86 and =AVERAGE(C2:C8) gives 77.00, so Method B scored about 6.1 points higher. The AVERAGE function guide covers the basics, and the average, min and max lesson practises them. The medians, 71 and 77, tell the same story, so no single extreme score is pulling the averages. The guide to average vs median explains why that check matters.

How to use the T.TEST function#

T.TEST takes the two ranges plus two settings and returns the p-value directly:

Excel formula
=T.TEST(array1, array2, tails, type)
ArgumentWhat it meansExample
array1First group's numbersB2:B8
array2Second group's numbersC2:C8
tails1 for a one-tailed test, 2 for two-tailed2
type1 paired, 2 two-sample equal variance, 3 two-sample unequal variance3

For the quiz data:

Excel formula
=T.TEST(B2:B8,C2:C8,2,3)

The result is about 0.0039. With type 2 instead of 3, the answer is almost identical here, because the two groups spread out by a similar amount (standard deviations of about 3.2 and 3.3).

T.TEST works in Excel 2010 and later, including Microsoft 365 and Excel for Mac. Older files may use TTEST, which takes the same arguments and gives the same result.

How to choose the tails and type#

The tails and type settings change the answer, so choose them for the design of your study, not for the result you hope to get.

Tails. Use 2 in almost every case. A two-tailed test asks "are the averages different in either direction?" Use 1 only if you decided before collecting data that only one direction mattered. A one-tailed p-value is half the two-tailed one (about 0.0020 here), so picking it after seeing the data makes weak evidence look stronger.

Type. Match it to how the data was collected:

  • Type 1, paired. The same people or items measured twice, such as each learner before and after training. Each row must belong together, and both ranges need the same number of values or T.TEST returns #N/A.
  • Type 2, equal variance. Two separate groups that you have good reason to believe vary by the same amount.
  • Type 3, unequal variance (often called Welch's t-test). Two separate groups, with no assumption about their spread. When unsure, use this one.

The choice matters. If the quiz data were seven learners tested twice, a paired test, =T.TEST(B2:B8,C2:C8,2,1), would give about 0.019 instead of 0.0039. It's a different question, so it gets a different answer.

How to read the p-value correctly#

The p-value is the probability of seeing a difference at least as large as yours if the true averages were equal. For the quiz data, p ≈ 0.0039 means that if both methods really produced the same average score, a gap of 6.1 points or more would turn up in only about 0.4% of samples like this one.

The usual rule is to call a result statistically significant when p is below 0.05, a cut-off chosen before the test. By that rule, the quiz result is significant.

Three things a p-value does not tell you:

  1. It isn't the chance that the result is a fluke. A p-value of 0.0039 doesn't mean a 0.39% chance that Method B is no better.
  2. It isn't the size of the effect. A tiny, unimportant difference can have a small p-value if the sample is huge. Always report the difference itself: 6.1 points.
  3. A p-value above 0.05 doesn't prove the groups are equal. It only means this data doesn't give strong evidence of a difference. Small samples often miss real differences.

How to run a t-test with the Analysis ToolPak#

The Analysis ToolPak gives a full results table, including the t statistic that T.TEST doesn't show. It is an add-in that comes with desktop Excel but is switched off by default.

  1. Turn it on. Windows: File > Options > Add-ins, choose Excel Add-ins in the Manage box, click Go and tick Analysis ToolPak. Mac: Tools > Excel Add-ins and tick Analysis ToolPak.
  2. Go to Data > Data Analysis and pick t-Test: Two-Sample Assuming Unequal Variances (or the Paired or Equal Variances version).
  3. Set Variable 1 Range to B1:B8 and Variable 2 Range to C1:C8, tick Labels, leave Hypothesized Mean Difference at 0 and Alpha at 0.05.
  4. Choose an output cell and click OK.

The key rows of the output for the quiz data:

RowMethod AMethod B
Mean70.8677.00
Variance10.1410.67
Observations77
df12
t Stat-3.56
P(T<=t) two-tail0.0039
t Critical two-tail2.18

The t Stat is negative only because Method A came first. What matters is its size: 3.56 is bigger than the critical value 2.18, which is the same conclusion as p below 0.05. Unlike T.TEST, the ToolPak output is a fixed table of values, so run it again if the data changes.

Check your data before you trust the result#

A t-test is reliable when its basic conditions hold, and a few quick checks catch most problems:

  • Independent values. Each score should come from a different person or item, unless you use the paired type.
  • No extreme outliers. Compare the average and the median, and look at MIN and MAX. One wild value can swing a small sample. The median and mode lesson practises the median check.
  • Roughly symmetric data, especially with small groups. Very skewed data, such as incomes, may need a different test.
  • Spread. The guide to standard deviation in Excel shows how to measure it; similar spreads support type 2, very different spreads call for type 3. See STDEV.S vs STDEV.P for which formula to use on a sample.

A t-test compares exactly two groups. For three or more, such as Methods A, B and C, use analysis of variance (the ToolPak's Anova: Single Factor) rather than several t-tests.

Practise it#

A t-test is only as good as the averages behind it. Try the exercise on this page, which measures the gap before any test, then practise AVERAGE, MIN and MAX in a live spreadsheet and practise MEDIAN and MODE. Each lesson checks your formula the moment you press Enter.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

Seven learners used Method A and seven others used Method B. Before any t-test, look at the size of the difference. Click F2 and calculate the average of Method B (C2:C8) minus the average of Method A (B2:B8).

fx
ABCDEFG
1
Learner
Method A
Method B
2
1
68
74
Difference
3
2
72
79
4
3
75
72
5
4
70
81
6
5
66
77
7
6
74
76
8
7
71
80
9
10
11

Tip: Subtract one AVERAGE from another: AVERAGE(C2:C8) minus AVERAGE(B2:B8).

Practise this in a lesson

LessonAVERAGE, MIN and MAXSummarize a list with its average, smallest and largest values.LessonMEDIAN and MODESee how one outlier skews an average, and describe typical values with MEDIAN and MODE.Function guideAVERAGECalculate the mean in Excel with AVERAGE. See how it treats blanks and zeros, avoid common errors, and practice in a live sheet.

Frequently asked questions

What does T.TEST return in Excel?

+

T.TEST returns the p-value of a Student's t-test. It does not return the t statistic itself. To see the t statistic, degrees of freedom and critical values, use the Analysis ToolPak's t-Test tools.

Which type should I use in T.TEST?

+

Use 1 when the two ranges are paired, such as the same people before and after. For two separate groups, use 3 (unequal variances), which is a safe default, or 2 if you have good reason to assume equal variances.

What does a p-value of 0.05 mean?

+

It means that if the two groups truly had the same average, a difference at least as large as yours would appear in about 5% of samples. It does not mean there is a 95% chance your result is real.

Should I use a one-tailed or two-tailed t-test?

+

Use two tails in most cases. A one-tailed test is only fair when you decided the direction of the difference before collecting the data. Switching to one tail after seeing the result halves the p-value and overstates the evidence.

What is the difference between TTEST and T.TEST?

+

They give the same result. T.TEST was added in Excel 2010 and is the current name. TTEST is kept for compatibility with older files.

Sources

  • AVERAGE function - Microsoft Support
  • MEDIAN function - Microsoft Support

Written and checked by the ExcelReady Team. First published November 3, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. What does a t-test tell you?
  2. How to use the T.TEST function
  3. How to choose the tails and type
  4. How to read the p-value correctly
  5. How to run a t-test with the Analysis ToolPak
  6. Check your data before you trust the result
  7. Practise it

Keep reading

Math· 7 min read

How to Calculate Standard Deviation in Excel

To calculate standard deviation in Excel, use =STDEV.S(B2:B7) when your data is a sample, or =STDEV.P(B2:B7) when it covers the whole group you care about. Standard deviation measures how far values typically sit from the average. A small result means the values are close together; a large one means they are spread out.

Comparisons· 7 min read

STDEV.S vs STDEV.P: Sample or Population?

Use STDEV.S when your numbers are a sample taken from a bigger group, such as six weeks out of a year. Use STDEV.P when your numbers are the whole group you care about, such as every person on one team. STDEV.S divides by n minus 1, so it always gives a slightly larger result. When in doubt, use STDEV.S.

Comparisons· 7 min read

AVERAGE vs MEDIAN: Which Tells the Truth?

Use MEDIAN to describe a typical value when a few very large or very small numbers could skew the result, such as salaries, house prices or order values. Use AVERAGE when the values are fairly even, or when you need a number that multiplies back to the total, as in budgets. When the two differ a lot, report both.

More on math

  • WACC Formula in Excel: Weighted Average Cost of Capital
  • How to Calculate a Weighted Average in Excel
  • Calculate a Z-Score in Excel With STANDARDIZE
  • Absolute References and the $ Sign in Excel
  • Absolute Value in Excel: How the ABS Function Works
  • How to Run a One-Way ANOVA in Excel
All math articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free