ExcelReady › t-test in Excel

Statistics in Excel · T.TEST

How to do a t-test in Excel (T.TEST, step by step)

A t-test tells you whether the difference between two groups of numbers is likely to be real or just chance. In Excel, the T.TEST function does it in one formula and returns the p-value.

The T.TEST formula

=T.TEST(array1, array2, tails, type)

ArgumentWhat to enter
array1The first group of numbers, for example B2:B8
array2The second group, for example C2:C8
tails2 if you're testing for any difference (the usual choice), 1 if you predicted the direction in advance
type1 paired: the same people or items measured twice
2 two independent groups with similar spread (equal variance)
3 two independent groups with different spread (unequal variance, Welch's t-test)

The result is a p-value, not the t statistic. The older name TTEST works the same way.

Example 1: a paired t-test (before and after)

Seven students took a test before and after a training course. Same students, measured twice, so the data is paired.

Try itNo sign-up

Did the training change the scores?

In C10, use T.TEST to get the two-tailed p-value for the before and after scores.

How to read the p-value

Example 2: two independent groups (Welch's t-test)

Two different stores, different days, different numbers of days: independent groups. When you're not sure the spread is equal, type 3 is the safe choice.

Try itNo sign-up

Do the two stores sell differently?

In C12, use T.TEST to compare daily sales of Store A (B2:B10) and Store B (C2:C9), two-tailed, unequal variance.

Which type should I use?

Your dataType
Same people, items or places measured twice (before/after, left/right)1, paired
Two separate groups, similar spread2, equal variance
Two separate groups, spread unknown or different3, unequal variance (Welch)

If you also need the t statistic and degrees of freedom, Excel's Analysis ToolPak (Data › Data Analysis) has t-test tools that print a full table. For the standard deviation of each group, use =STDEV.S(range).

Using Excel for more than statistics?

Take the free 10-minute skills test and see which Excel skills to brush up.

Start the free test

Frequently asked questions

What does T.TEST return in Excel?

The p-value: the probability of seeing a difference at least this large if there were no real difference between the groups. It does not return the t statistic.

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

Use two tails unless you decided before collecting the data that only one direction matters. A one-tailed p-value is half the two-tailed one, so choosing it afterwards overstates the result.

What is the difference between type 2 and type 3?

Type 2 assumes both groups have the same variance; type 3 (Welch's t-test) doesn't. When in doubt, type 3 is the safer choice.

Why does T.TEST give #N/A?

For a paired test (type 1), both ranges must have the same number of values. Different lengths give #N/A.

More free Excel resources