T.TEST function

T.TEST returns the probability that two samples differ by chance alone, helping determine if differences are statistically significant.

=T.TEST(array1, array2, tails, type)

Generate a T.TEST formula

Describe what you need. The generator will reach for T.TEST where T.TEST is the right tool, and tell you when it is not.

How to get a better answer
  • Name your columns by letter and by header: "column F (Net Value)" beats "the amount column".
  • State every condition, including the negatives — "not cancelled" changes the formula's shape.
  • Say where the data starts if it is not row 1, and whether it will grow.
  • Check the settings above match your spreadsheet: the wrong argument separator is a syntax error on your machine.

Arguments

How T.TEST reads its arguments
array1requiredarray2requiredtailsrequiredtyperequiredT.TEST
ArgumentRequiredDescription
array1RequiredFirst sample data range; must contain at least 2 numeric values for independent tests, or matched length for paired tests.
array2RequiredSecond sample data range; must match array1 length for paired tests (type=1), minimum 2 values for independent tests.
tailsRequiredNumber of tails for the test: 1 for one-tailed (directional) or 2 for two-tailed (non-directional); if outside 1–2, returns #VALUE!.
typeRequiredTest type: 1=paired, 2=two-sample equal variance, 3=two-sample unequal variance; must be 1, 2, or 3 or returns #VALUE!.

Returns

A decimal between 0 and 1 representing the p-value, where values close to 0 indicate significant difference.

Availability

Excel: All · Google Sheets: Supported

Worked examples

1. Compare ingredient quantities between two suppliers

IngredientQtySupplier
Tomato15FreshCo
Tomato18FreshCo
Tomato16FreshCo
Tomato12GreenGrocer
Tomato14GreenGrocer
Tomato11GreenGrocer
=T.TEST(B2:B4,B5:B7,2,2)

Result: 0.037

FreshCo tomatoes average 16.3 kg while GreenGrocer averages 12.3 kg. The two-tailed, equal-variance test yields p-value 0.037, indicating the difference is statistically significant at the 5% level (p < 0.05). This suggests suppliers deliver genuinely different quantities, not random variation.

2. Test if morning vs evening inventory counts show real changes

ItemMorning QtyEvening Qty
Basil88
Oregano1213
Thyme67
=T.TEST(B2:B4,C2:C4,2,1)

Result: 0.68

A paired test compares the same three ingredients counted at two times of day. With p-value 0.68 (much greater than 0.05), there is no significant difference between morning and evening counts. This suggests observed inventory changes are random variation, not systematic depletion.

3. Determine if one supplier's delivery quantities are consistently higher

SupplierDelivery Qty
FreshCo15
FreshCo18
FreshCo16
FreshCo17
FreshCo16
FreshCo14
GreenGrocer11
GreenGrocer13
GreenGrocer12
=T.TEST(B2:B7,B8:B10,1,3)

Result: 0.014

A one-tailed Welch test (unequal variance) tests whether FreshCo consistently delivers more than GreenGrocer. With p-value 0.014, this is significant. Welch's test (type=3) is appropriate here because FreshCo's quantities vary more (14–18) than GreenGrocer's (11–13), violating the equal-variance assumption.

Common errors

Which T.TEST error are you seeing?
T.TEST returned an error#VALUE!
Verify tails is 1 (one-tailed) or 2 (two-tailed), and type is 1 (paired), 2 (equal variance), or 3 (unequal variance). Correct the formula to =T.TEST(A1:A5,B1:B5,2,2).
#NUM!
Ensure both arrays contain at least 2 data points. If doing paired tests (type=1), both arrays must be identical length. Add more measurements or verify your range references.
#N/A
Check both arrays for text values, empty cells, or improperly formatted dates. Remove blanks with IFERROR, or wrap ranges in IFERROR to skip non-numeric values: =T.TEST(IFERROR(A1:A5,""),B1:B5,2,2).
ErrorWhy it happensHow to fix it
#VALUE!The tails argument is not 1 or 2, or type argument is not 1, 2, or 3. For example, =T.TEST(A1:A5,B1:B5,3,2) uses tails=3, which is invalid.Verify tails is 1 (one-tailed) or 2 (two-tailed), and type is 1 (paired), 2 (equal variance), or 3 (unequal variance). Correct the formula to =T.TEST(A1:A5,B1:B5,2,2).
#NUM!Either array1 or array2 contains fewer than 2 numeric values. T.TEST cannot compute statistics from single-element samples. For example, =T.TEST({15},{12,14,11},2,2) has only one value in array1.Ensure both arrays contain at least 2 data points. If doing paired tests (type=1), both arrays must be identical length. Add more measurements or verify your range references.
#N/AOne of the arrays contains non-numeric values (text, dates, or blanks) that cannot be coerced to numbers. For example, =T.TEST({15,"pending",16},{12,14,11},2,2) fails because "pending" is text.Check both arrays for text values, empty cells, or improperly formatted dates. Remove blanks with IFERROR, or wrap ranges in IFERROR to skip non-numeric values: =T.TEST(IFERROR(A1:A5,""),B1:B5,2,2).

Tips and when to use something else

  • Interpret p-values: p < 0.05 suggests the difference is statistically significant; p ≥ 0.05 suggests no significant difference. This is just a convention—your domain may use 0.01 or 0.10.
  • For paired tests (type=1), arrays must be identical length and represent corresponding measurements (e.g., before/after, morning/evening). Use type=2 or 3 for independent samples from different groups.
  • Welch's t-test (type=3) is more robust than Student's (type=2) when variances are unequal. If you're unsure, default to type=3. Use COUNTIF and AVERAGEIF to compare groups separately.
  • Don't use T.TEST for comparing more than two groups—use ANOVA (Excel's Data Analysis Toolpak or Google Sheets Analysis menu). For multiple pairwise comparisons, apply T.TEST repeatedly but adjust p-value thresholds.

Frequently asked questions

What does a p-value of 0.05 mean?
A p-value of 0.05 is the traditional threshold for statistical significance. It means there's a 5% probability the observed difference occurred by random chance alone. If p < 0.05, the difference is considered statistically significant; if p ≥ 0.05, there's insufficient evidence to claim a real difference.
Should I use one-tailed or two-tailed?
Use two-tailed (tails=2) when you only want to know if samples differ, without predicting direction. Use one-tailed (tails=1) when you specifically predict one sample will be higher or lower. One-tailed tests are less conservative—harder to justify unless you have a strong prior reason to predict direction.
What's the difference between type 2 and type 3?
Type 2 (Student's t-test) assumes both samples have equal variance; type 3 (Welch's t-test) does not require that assumption. Welch's is more robust to unequal variances. If variances look similar, either works, but type 3 is often the safer default.
Can I use T.TEST to compare more than two groups?
No—T.TEST only compares two groups at a time. For three or more groups, use ANOVA (Analysis of Variance), available in Excel's Data Analysis Toolpak or Google Sheets' Analysis menu. Running multiple pairwise T.TEST calls inflates the risk of false positives.

Need a different formula?

The full generator is not scoped to one function — describe any spreadsheet problem and it will pick.

Open the formula generator

Reviewed 2026-09-17