Excel functions / Statistics

T.TEST function

Student's t-test: the chance that two samples would differ this much if they came from populations with the same mean.

Syntax

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

Arguments

When to use it

T.TEST compares two sets of numbers and gives a p-value: the chance of seeing a difference this large between their averages if there were really no difference at all. A small p-value, by convention below 0.05, is taken to mean the difference is real.

The last two arguments matter. Tails is 2 unless you only care about a difference in one direction. Type is 1 when the two sets are the same things measured twice (paired), 2 for two separate groups with similar spread, and 3 for two separate groups whose spread may differ.

Examples

  1. The same six people, before and after training

    ABCD
    1BeforeAfter
    272780.0010
    36871
    47580
    58082
    66670
    77479

    In D2: =T.TEST(A2:A7, B2:B7, 2, 1) → 0.0010

    Paired, because each row is one person. A p-value this small says the improvement is very unlikely to be chance.

    Try this example

  2. The same numbers treated as two separate groups

    ABCD
    1BeforeAfter
    272780.1802
    36871
    47580
    58082
    66670
    77479

    In D2: =T.TEST(A2:A7, B2:B7, 2, 3) → 0.1802

    Ignoring the pairing throws away information, and the difference no longer looks convincing.

    Try this example

Common mistakes

Common questions

How do I do a t-test in Excel?

Put the two sets of numbers in two columns and use =T.TEST(first, second, 2, type), where type is 1 for paired data, 2 for two groups with equal variance and 3 for unequal variance. The result is the p-value.

T.TEST in other languages

Excel shows function names in its own language. In these languages it also puts a semicolon between arguments where English has a comma.

Translate a whole formula

Also written as TTEST.

Try T.TEST in the playground

Related functions