T.TEST

Return the p-value of a Student's t-test to check whether two data sets have the same mean.

Statistical
|
Excel 2010+
|
Google Sheets Supported

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

T.TEST returns the probability (p-value) from a Student's t-test. It tells you how likely it is that two samples come from populations with the same mean. A small p-value (typically below 0.05) suggests the difference between the groups is statistically significant, not just random chance.

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

See how switching between a one-tailed and two-tailed test changes the p-value. Edit the sales data and watch both results update side by side.

Spreadsheet editor

Paired test with mismatched array sizes

Watch what happens when you use a paired test (type 1) with arrays of different lengths: you get #N/A. Change the last argument from 1 to 3 to fix the error.

Spreadsheet editor

Auto-labeling results with IF

Wrap T.TEST inside IF to automatically label results as significant or not. Try changing the data values and see when the label flips from Yes to No.

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.

Tips & notes

T.TEST is available in Excel 2010 and later. In earlier versions, use TTEST instead. The tails and type arguments are truncated to integers, so 1.9 is treated as 1. The function returns a value between 0 and 1.

Common questions

What does the p-value from T.TEST mean?

The p-value is the probability of seeing a difference as large as the one in your data if the two groups actually have the same mean. A small p-value (below 0.05 is a common threshold) suggests the difference is real, not just random variation.

When should I use a one-tailed vs. two-tailed test?

Use a one-tailed test (tails = 1) when you only care about one direction, for example whether a new method is better than the old one. Use a two-tailed test (tails = 2) when any difference matters, regardless of direction.

What is the difference between T.TEST and TTEST?

They produce the same result. T.TEST is the updated version introduced in Excel 2010. TTEST is the older compatibility version. Microsoft recommends using T.TEST in new workbooks.