T.TEST
Return the p-value of a Student's t-test to check whether two data sets have the same mean.
Spreadsheet editor
Spreadsheet editor
Syntax
=T.TEST(array1, array2, tails, type)
Returns: Number Arguments
| Argument | Required | Description |
|---|---|---|
| array1 | Yes | The first set of data values to compare. |
| array2 | Yes | The second set of data values to compare. |
| tails | Yes | The number of distribution tails. Use 1 for a one-tailed test or 2 for a two-tailed test. |
| type | Yes | The kind of t-test to run. 1 = paired, 2 = two-sample equal variance (homoscedastic), 3 = two-sample unequal variance (heteroscedastic). |
About
Use T.TEST when you need to compare two groups of numbers, for example test scores before and after a training program, sales figures from two regions, or response times for two website designs. Choose a paired test (type 1) when both samples come from the same subjects, or an unpaired test (type 2 or 3) when comparing independent groups.
T.TEST replaced the older TTEST function starting in Excel 2010. For related distribution calculations, see T.DIST and T.INV. If you need the actual t-statistic rather than the p-value, you will need to calculate it manually or use the Data Analysis ToolPak.
Examples
One-tailed vs two-tailed comparison
Spreadsheet editor
Paired test with mismatched array sizes
Spreadsheet editor
Auto-labeling results with IF
Spreadsheet editor
Watch out for
Using paired test with unequal sample sizes
Setting type to 1 (paired) when array1 and array2 have different numbers of data points returns #N/A.
→ Make sure both arrays have the same number of values for a paired test. If sample sizes differ, use type 2 or 3 instead.
Mixing up tails and type
Swapping the tails and type arguments gives misleading results without any error, since both accept small integers.
→ Remember the order: tails (1 or 2) comes before type (1, 2, or 3). Double-check which value you placed in each position.
Non-numeric or empty cells in the arrays
Text values or errors in the data range cause T.TEST to return #VALUE!.
→ Clean your data first. Remove or fix non-numeric entries. T.TEST ignores empty cells but not text or error values.
Choosing the wrong type for your data
Using type 2 (equal variance) when the two groups have very different spreads can produce unreliable p-values.
→ If you are unsure whether your groups have equal variance, use type 3 (unequal variance). It is the safer default for independent samples.