The Student's test is related to the t-distribution. Its density function is
where is the Gamma function and the parameter degree of freedom.
If type=1, TTEST calculates the p-value for paired samples. It uses the differences of the pairs. So in this case the data X and Y should have the same count n.
Unpaired Samples, Equal Variance
If type = 2, TTEST calculates the p-value of a comparison of means for independent samples from populations with equal variance. Besides
it uses the pooled variance
Unpaired Samples, Unequal Variances
If type = 3, TTEST calculates the p-value of a comparison of means for independent samples from populations with not necessarily equal variances.
TTEST returns .
OpenOffice.org uses internally the regularized incomplete beta function to calculate the integral.
An empty element or an element of type string is ignored and in case paired samples its corresponding element in the other sample too. In contrast to other spreadsheet applications OpenOffice.org has no type boolean but treats false as 0 and true as 1.