TTEST function
TTEST compares two sets of results, such as before and after, and returns the p-value showing how likely the difference is chance. It is a compatibility function, so use T.TEST in new workbooks.
Example
Read it as a sentence: compare A1:A8 with F1:F5 using two tails and type 2 (equal variance), which gives 0.100081711.
Excel shows 0.100081711
A
F
1
2
1
2
4
2
3
4
3
4
4
4
5
5
5
6
5
7
7
8
9
Data
Syntax
TTEST(array1, array2, tails, type)
-
array1(required) - First sample.
-
array2(required) - Second sample.
-
tails(required) - 1 or 2.
-
type(required) - 1 paired, 2 equal variance, 3 unequal variance.
Returns: The p-value of a t-test.
What Excel actually returns
Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.
| Formula | Excel shows | Case |
|---|---|---|
=TTEST({3,4,5,8,9,1,2,4,5},{6,19,3,2,14,4,5,17,1},2,2) | 0.191995887 | Array constants |
=TTEST(Data!A1:A8,Data!F1:F5,2,2) | 0.100081711 | Two-tailed, equal variance |
=TTEST(Data!A1:A8,Data!F1:F5,1,2) | 0.050040856 | One-tailed |
=TTEST(Data!A1:A8,Data!F1:F5,2,3) | 0.080704593 | Unequal variance (type 3) |
=TTEST(Data!F1:F5,Data!G1:G5,2,1) | 0.089009343 | Paired (type 1) equal sizes |
=TTEST(Data!A1:A8,Data!F1:F5,2.9,2) | 0.100081711 | Fractional tails truncated |
=TTEST({1},{2,3},2,2) | #DIV/0! | One-point sample |
=TTEST(Data!A1:A8,Data!F1:F5,2,1) | #N/A | Paired with different sizes |
The Data sheet these formulas read
A cell that starts with = holds that formula.
A
F
G
1
2
1
2
2
4
2
4
3
4
3
5
4
4
4
4
5
5
5
5
6
5
7
7
8
9
Data
Watch out for
- Superseded by T.TEST; use that in new workbooks.
- Type 1 needs equal-length arrays.
Where it works
- Excel
- TTEST is in every version of Excel from 2007 on. Compatibility function: still works in every version, but newer replacements exist.
- Google Sheets
- Same name, same behaviour for everyday use.
Part of Compatibility functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .