T.TEST
Returns the p-value from a Student t-test comparing two numeric samples.
T.TEST supports paired, equal-variance two-sample, and unequal-variance (Welch) modes.
The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.
Syntax
=T.TEST(array1, array2, tails, type)
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
array1 | number (range) | Required | — |
array2 | number (range) | Required | — |
tails | number | Required | — |
type | number | Required | — |
Remarks
tailsmust be1(one-tailed) or2(two-tailed).typemust be1(paired),2(two-sample equal variance), or3(Welch).
Error cases
- Returns
#N/Awhen paired mode arrays have different lengths. - Returns
#NUM!or#DIV/0!for invalid setup or degenerate variance conditions.
Examples
Perform a paired two-tailed comparison of corresponding observations.
Formula =T.TEST({10,12,11,14},{11,13,12,16},2,1)
Expected result 0.0153924380733024
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Test one tail with independent samples and unequal variances.
Formula =T.TEST({10,12,11,14},{11,13,12,16},1,3)
Expected result 0.200367342434037
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Use two matched pairs with differing differences.
Formula =T.TEST({1,5},{2,9},2,1)
Expected result 0.344041739245261
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
The number of tails must be one or two.
Formula =T.TEST({10,12,11,14},{11,13,12,16},3,1)
Expected result #NUM!
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Two-tailed equal-variance test with identical samples
Formula =T.TEST({1,2,3},{1,2,3},2,2)
Expected result 1
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
One-tailed Welch test with identical samples
Formula =T.TEST({1,2,3},{1,2,3},1,3)
Expected result 0.5
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.