Tabellab
Data, tech, science & health

T-test in Excel: compare two means with T.TEST

A two-sample t-test checks whether the difference between two group means is larger than chance would explain. In Excel, =T.TEST(array1, array2, tails, type) returns the p-value directly; =T.TEST(B2:B11,C2:C13,2,3) is a two-tailed Welch test for unequal variances. In the example, ten calls with the old script average 8.62 minutes and twelve calls with the new script 7.48 minutes. The difference of 1.14 minutes gives p = 0.0028 (t = 3.48), well below 0.05, so the difference is statistically significant. The 95% confidence interval for the saving runs from 0.45 to 1.83 minutes.

Updated 30 Oct 2026 5 min read By Tabellab team

T.TEST syntax: tails and type

array1, array2: the two samples. For types 2 and 3 they may have different lengths, as here (10 and 12). tails: 2 for a two-tailed test (is there any difference?), 1 for a one-tailed test (is group 1 specifically larger, or smaller?). type: 1 = paired, 2 = two samples with equal variances, 3 = two samples with unequal variances (Welch).

The result is a p-value, not the t statistic: the probability of a difference at least this large if the true means were equal. If p is below the significance level you chose in advance, usually 0.05, the difference is called significant. In the example the Welch two-tailed p-value is 0.0028, the equal-variance version gives 0.0020, and the one-tailed Welch test gives exactly half the two-tailed value, 0.0014.

Which type to choose

Paired (type 1) when each value in one column belongs to a specific value in the other: the same employees before and after training, the same stores in two months. The test works on the differences per pair and needs equal-length ranges with pairs in the same rows. Independent groups otherwise: different calls, different customers, different visitors in an A/B test.

For independent groups, type 3 (Welch) is the safer default. It does not assume equal variances and loses very little power when the variances happen to be equal. The pooled type 2 test can give misleading p-values when the variances and the group sizes differ. Choose one-tailed tests only if the direction was fixed before looking at the data; choosing the tail after seeing the result halves the p-value unfairly.

If you prefer a full report table, the Analysis ToolPak offers the same three tests (paired, equal variances, unequal variances) and prints means, variances, t, degrees of freedom and both p-values. The T.TEST formula has the advantage that it recalculates as soon as the data change.

Worked example: call handling time, old vs new script

Handling times in minutes (yellow), 10 calls with the old script and 12 with the new one. The summary runs T.TEST three ways and rebuilds the Welch test by hand.

Worked example: call handling time, old vs new script
ABC
1CallOld script (min)New script (min)
2#18.27.1
3#27.57.8
4#39.16.9
5#48.88.4
6#57.97.3
7#610.26.5
8#78.57.9
9#89.47.6
10#97.78.8
11#108.96.8
12#117.2
13#127.5
14
15SummaryValue
16Mean old8.62
17Mean new7.48
18Std dev old (STDEV.S)0.834
19Std dev new (STDEV.S)0.667
20n old10
21n new12
22Difference in means (old − new)1.14
23p-value, Welch, two-tailed: T.TEST(…,2,3)0.0028
24p-value, equal variances: T.TEST(…,2,2)0.0020
25p-value, Welch, one-tailed: T.TEST(…,1,3)0.0014
26Standard error of the difference0.327
27Welch t statistic3.48
28Welch degrees of freedom17.17
29Critical t at 5%, two-tailed (T.INV.2T)2.110
3095% CI for the difference, lower0.45
3195% CI for the difference, upper1.83
32Decision at α = 5%Significant
Key formulas
  • C23=T.TEST(B2:B11,C2:C13,2,3)Two-tailed Welch t-test
  • C24=T.TEST(B2:B11,C2:C13,2,2)Two-tailed, equal variances
  • C25=T.TEST(B2:B11,C2:C13,1,3)One-tailed Welch t-test
  • C26=SQRT(C18^2/C20+C19^2/C21)Standard error of the difference
  • C27=C22/C26Welch t statistic
  • C28=C26^4/((C18^2/C20)^2/(C20-1)+(C19^2/C21)^2/(C21-1))Welch–Satterthwaite degrees of freedom
  • C29=T.INV.2T(0.05,C28)Critical t, df truncated
  • C30=C22-C29*C26Lower 95% confidence limit

Fictional call-centre data. Significance at α = 5%, two-tailed.

The Welch t-test by hand

To see what T.TEST does, rebuild it. 1. Means and sample standard deviations with AVERAGE and STDEV.S: 8.62 and 0.834 for the old script, 7.48 and 0.667 for the new one. 2. Standard error of the difference: =SQRT(C18^2/C20+C19^2/C21) = √(0.834²/10 + 0.667²/12) = 0.327. 3. t = difference ÷ standard error = 1.137 ÷ 0.327 = 3.48. 4. Welch degrees of freedom with the Welch–Satterthwaite formula: 17.17.

5. Critical value: =T.INV.2T(0.05,C28) = 2.110. Because |t| = 3.48 is larger than 2.110, the result is significant at 5%, matching the p-value. Note that T.INV.2T and T.DIST.2T truncate the degrees of freedom to a whole number (17), so a p-value calculated by hand with T.DIST.2T can differ slightly in the last digits from T.TEST. 6. Confidence interval: difference ± critical t × standard error = 1.137 ± 2.110 × 0.327, from 0.45 to 1.83 minutes. The interval excludes zero, which is the same conclusion seen another way.

Reading the result correctly

A small p-value says the difference is unlikely to be pure noise; it does not say the difference is large or important. Always report the size of the effect too, here 1.14 minutes per call or about 13%, with its confidence interval. With very large samples even trivial differences become significant, and with very small ones real differences can be missed.

The t-test assumes independent observations and roughly normal means. With ten or more values per group and no extreme outliers, the means are usually close enough to normal. For heavily skewed data or ratings on a short scale, compare with the Mann-Whitney U test; for three or more groups use one-way ANOVA instead of many pairwise t-tests. To plan how many observations you need before a test, see A/B test sample size.

Common mistakes

  • Reading T.TEST as the t statistic. T.TEST returns the p-value. Calculate t separately if you need it.
  • Using type 1 for independent groups. A paired test needs real pairs. With different people or calls in each group, use type 3.
  • Choosing one tail after seeing the data. It halves the p-value. Decide the direction before the test.
  • Defaulting to equal variances. Type 2 can mislead when group sizes and spreads differ. Welch is safer.
  • Reporting only p. Add the difference in means and its confidence interval so readers see the size of the effect.
  • Running many t-tests on many groups. Each extra test raises the chance of a false positive. Use ANOVA or correct the significance level.

Frequently asked questions

How do I do a t-test in Excel?

Use =T.TEST(range1, range2, tails, type). For two independent groups and a two-sided question, =T.TEST(A2:A11, B2:B13, 2, 3) runs a Welch t-test and returns the p-value.

What do tails and type mean in T.TEST?

Tails is 1 for a one-tailed and 2 for a two-tailed test. Type is 1 for paired data, 2 for two samples with equal variances and 3 for two samples with unequal variances.

How do I interpret the T.TEST result?

It is a p-value. If it is below your significance level, usually 0.05, the difference between the means is statistically significant. It does not tell you how large the difference is.

Should I use a t-test with equal or unequal variances?

For independent groups the unequal-variance Welch test (type 3) is a safe default. It stays valid when the variances differ and loses very little when they are equal.

How do I get the t statistic in Excel?

Calculate it from the means, standard deviations and counts: for Welch, t = (mean1 - mean2) / SQRT(sd1^2/n1 + sd2^2/n2). The Analysis ToolPak's t-test tools also print it.

Practise it in a lab

Related guides

Reading is step one. Doing is step two.

Every guide links to a lab where you build the same calculation in an online spreadsheet and get instant feedback.

Open the lab