Hello
The maps between t value and p value are provided by TINV() and TDIST().
t value = TINV(p value, degrees of freedom)
p value = TDIST(t value, degrees of freedom, number of tails)
The t distribution is determined by the degrees of freedom (d.o.f.) of the t statistic in use and the d.o.f. is determined by the type of t-test and the sample size.
E.g.
For t-test of paired samples X (sample size = N, i.e., pair count = N, data count = 2 * N), d.o.f. = N - 1.
For t-test of two independent samples X1, X2 assumed to have equal population variance (sample size = N1, N2 resp.), d.o.f. = N1 + N2 - 2.
If you want t value, you may a) use t = TINV(TTEST(), d.o.f.) or b) calculate it directly from sample data without using TTEST() function.
E.g.,
p = TTEST(samples_1, samples_2, 2, 2)
is equivalent to -
X1 = samples_1
X2 = samples_2
N1 = COUNT(X1)
N2 = COUNT(X2)
PV = (VAR(X1) * (N1 - 1) + VAR(X2) * (N2 - 1)) / (N1 + N2 - 2)
t = (SUM(X1) / N1 - SUM(X2) / N2) / SQRT(PV * (1 / N1 + 1 / N2))
p = TDIST( ABS(t), N1 + N2 - 2, 2)
*PV is pooled variance.
Hope this helps,
H