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)| Argument | What it means | |
|---|---|---|
array1 | Required | The first data set. |
array2 | Required | The second data set. |
tails | Required | 1 for a one-tailed test (you predicted the direction), 2 for a two-tailed test. |
type | Required | 1 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)
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Employee | Before | After | ||
| 2 | E1 | 62 | 68 | 0.0058 | |
| 3 | E2 | 70 | 74 | ||
| 4 | E3 | 55 | 59 | ||
| 5 | E4 | 68 | 70 | ||
| 6 | E5 | 74 | 80 | ||
| 7 | E6 | 60 | 61 |
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
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Employee | Before | After | ||
| 2 | E1 | 62 | 68 | 0.0029 | |
| 3 | E2 | 70 | 74 | ||
| 4 | E3 | 55 | 59 | ||
| 5 | E4 | 68 | 70 | ||
| 6 | E5 | 74 | 80 | ||
| 7 | E6 | 60 | 61 |
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
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Day | Store A | Store B | ||
| 2 | D1 | 41 | 36 | 0.0097 | |
| 3 | D2 | 38 | 33 | ||
| 4 | D3 | 45 | 40 | ||
| 5 | D4 | 50 | 35 | ||
| 6 | D5 | 43 | 38 | ||
| 7 | D6 | 39 | 34 |
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).
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#N/A | Type 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.
| Language | Function name |
|---|---|
| Finnish | T.TESTI |
| Hungarian | T.PRÓB |
| Italian | TESTT |
| Portuguese (Brazil) | TESTE.T |
| Portuguese (Portugal) | TESTE.T |
| Russian | СТЬЮДЕНТ.ТЕСТ |
| Spanish | PRUEBA.T.N |