Statistical function

T.TEST function

Returns the p-value of a Student's t-test, telling you whether the averages of two groups differ by more than chance.

Available in Excel 2010 and later, Microsoft 365, Excel for the web, Excel for Mac 2011 and later

Excel 2010 and laterWorks in Google Sheets

Syntax

T.TEST(array1, array2, tails, type)
ArgumentWhat it means
array1RequiredThe first data set.
array2RequiredThe second data set.
tailsRequired1 for a one-tailed test (you predicted the direction), 2 for a two-tailed test.
typeRequired1 paired (same subjects measured twice), 2 two-sample with equal variances, 3 two-sample with unequal variances (Welch).

Returns: The p-value, between 0 and 1.

How T.TEST works

Two groups almost never have exactly the same average; the question is whether the gap is real or just random noise. T.TEST runs a complete Student's t-test on two ranges and returns the p-value: the probability of seeing a difference at least this large if the two groups really had the same average. A p-value below your chosen threshold (usually 0.05) is called statistically significant; above it, the data does not give convincing evidence of a difference.

Choose type carefully. Type 1 (paired) is for before/after measurements on the same people or items, and the two ranges must have the same length and order. Type 2 compares two independent groups assuming similar spread; type 3 (Welch's test) drops that assumption and is the safer default when in doubt. Use tails 2 unless you decided on the direction before collecting data. Statistical significance is not the same as importance: with big samples, tiny differences become significant.

Examples

1Did training improve scores? (paired)

E2fx=T.TEST(B2:B7, C2:C7, 2, 1)
ABCDE
1EmployeeBeforeAfter
2E162680.0058
3E27074
4E35559
5E46870
6E57480
7E66061

Result: 0.0058

Each employee was tested twice, so the test is paired. p = 0.005840 (shown to 4 decimals). Below 0.05: the average improvement of 3.83 points is unlikely to be chance.

2One-tailed paired test

E2fx=T.TEST(B2:B7, C2:C7, 1, 1)
ABCDE
1EmployeeBeforeAfter
2E162680.0029
3E27074
4E35559
5E46870
6E57480
7E66061

Result: 0.0029

If the HR team predicted an improvement before running the course, a one-tailed test is legitimate: p = 0.002920 (shown to 4 decimals), half the two-tailed value.

3Two stores, independent samples

E2fx=T.TEST(B2:B7, C2:C7, 2, 2)
ABCDE
1DayStore AStore B
2D141360.0097
3D23833
4D34540
5D45035
6D54338
7D63934

Result: 0.0097

Daily sales from two different stores are independent groups. Assuming similar spread (type 2), p = 0.009716 (shown to 4 decimals), clear evidence that Store A sells more on average (42.67 vs 36.00).

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 16 KB

Common errors and how to fix them

ErrorWhy it happensFix
#N/AType 1 (paired) with ranges of different sizes.Paired data must have one value per subject in each range.
#NUM!tails is not 1 or 2, or type is not 1, 2 or 3.Use tails 1/2 and type 1/2/3.
#DIV/0!Too few values or no variation (e.g. every paired difference is identical).Provide more varied data.

Tips

  • T.TEST returns only the p-value. To see the t statistic and degrees of freedom, use the Analysis ToolPak's t-Test tools.
  • Report the size of the difference (e.g. the averages) alongside the p-value, not just "significant".
  • TTEST is the older name with identical arguments.

Questions

What does a p-value of 0.03 mean?

If there were truly no difference, you would see a gap this large only about 3% of the time. It is not the probability that the groups are the same.

Which type should I use?

Same subjects measured twice: 1. Different subjects: 3 (Welch) is the safe default; use 2 only if you are confident the spreads are similar.

Google Sheets

T.TEST also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.

T.TEST in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
FinnishT.TESTI
HungarianT.PRÓB
ItalianTESTT
Portuguese (Brazil)TESTE.T
Portuguese (Portugal)TESTE.T
RussianСТЬЮДЕНТ.ТЕСТ
SpanishPRUEBA.T.N