Statistical

T.TEST Formula

Performs a Student's t-test and returns the p-value, telling you whether the means of two datasets are significantly different. It handles paired, equal-variance, and unequal-variance t-tests. This is the go-to function for comparing two groups in A/B testing, clinical trials, or any experiment with two conditions.

Syntax

T.TEST(array1, array2, tails, type)
ParameterDescription
array1 Parameter of the T.TEST function.
array2 Parameter of the T.TEST function.
tails Parameter of the T.TEST function.
type Parameter of the T.TEST function.
Try T.TEST in Viztab — free, no signup

Examples

A/B test comparison

Formula
=T.TEST(A2:A101, B2:B101, 2, 2)
Returns the two-tailed p-value comparing conversion rates in columns A and B using a two-sample equal-variance t-test. If p < 0.05, the difference is statistically significant.

Paired before/after test

Formula
=T.TEST(C2:C21, D2:D21, 2, 1)
Returns the p-value for a paired t-test comparing before (C) and after (D) measurements for the same 20 subjects.

Unequal variance comparison

Formula
=T.TEST(E2:E51, F2:F31, 2, 3)
Returns the p-value using Welch's t-test (type 3), appropriate when the two groups have different sample sizes (50 vs 30) and potentially different variances.

Common Errors

#N/A

For paired tests (type 1), both arrays must have the same number of data points. Mismatched lengths cause this error.

#NUM!

Tails must be 1 or 2, and type must be 1 (paired), 2 (equal variance), or 3 (unequal variance).

Tips

Choose the right type

Type 1 = paired (same subjects measured twice), Type 2 = two-sample equal variance, Type 3 = two-sample unequal variance (Welch's). When in doubt, use Type 3 — it is more conservative and does not assume equal variances.

Two-tailed is the default choice

Use tails=2 unless you have a strong a priori reason to test in only one direction. Two-tailed tests are the standard in most published research.

Interpret the p-value

The returned p-value is the probability of observing a difference this large (or larger) by chance alone. If p < your alpha (typically 0.05), reject the null hypothesis of equal means.

Try T.TEST in Viztab

Import your data and use T.TEST with 370+ other formulas. No signup required.

Open Viztab

Related Formulas