T.TEST in ONLYOFFICE: Paired, Pooled and Welch Two-Sample Tests
Use T.TEST with explicit tail conventions, independently checked examples and exact-source bounds and compatibility limits.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
=T.TEST(A2:A4,B2:B4,2,1) has the independent target 0.0741799002274485 for the paired numeric example below. The function returns a probability, not the t statistic. This guide also covers TTEST.
Syntax
T.TEST(array1, array2, tails, type)
Enter three fictional paired measurements
Create TestData with Method A in A1 and Method B in B1. Enter 2,4,6 in A2:A4 and 1,2,3 in B2:B4. The rows can represent three matched items for the paired example. The independent-sample examples deliberately reuse the numbers only to compare formulas; treating matched records as independent is not a recommendation.
The means are 4 and 2. Sample variances are 4 and 1. Paired differences A−B are 1,2,3, with mean 2 and sample variance 1. Keep the original records and their pairing unchanged when adding formulas in D2 onward.
Choose the design before the tails
The official reference requires both sample ranges, tails and type. Tails is 1 or 2. Type 1 is paired, type 2 is independent samples with equal variances, and type 3 is independent samples with unequal variances (Welch).
Pairing must come from the study design: the same item measured twice or intentionally matched observations. It is not justified by equal range lengths alone. Equal-variance pooling is a substantive assumption, and choosing the test that gives the smallest probability is not a valid design strategy.
Worked two-tail comparisons
| Cell | Formula | Independent target |
|---|---|---|
| D2 | =T.TEST(A2:A4,B2:B4,2,1) |
0.0741799002274485 |
| D3 | =T.TEST(A2:A4,B2:B4,2,2) |
0.196261178149270 |
| D4 | =T.TEST(A2:A4,B2:B4,2,3) |
0.220880840494096 |
| D5 | =T.TEST(A2:A4,B2:B4,1,1) |
0.0370899501137243 |
| D6 | =TTEST(A2:A4,B2:B4,2,1) |
0.0741799002274485 |
For the paired calculation, t=2/(1/√3)=√12≈3.46410161513775 and df=2. The df=2 two-tail formula is 1−t/√(t²+2), giving 1−√(6/7)≈0.0741799002274485.
For pooled independent samples, pooled variance is 2.5 and standard error is √(2.5×(1/3+1/3))=√(5/3). The absolute t is approximately 1.54919333848297 with df=4. Welch has the same standard error for these equal sample sizes but df=50/17≈2.94117647058824, explaining its different probability. This contrast is arithmetic, not a claim that all three analyses are appropriate for the same study.
Advanced: one-tail direction is not preserved
The inspected paired and independent calculations take absolute differences. Therefore swapping the two samples leaves the result unchanged, including tails=1. The one-tail result is the smaller tail associated with the magnitude, not an automatically correct p-value for any prespecified signed alternative.
For these data the reverse =T.TEST(B2:B4,A2:A4,1,1) still targets 0.0370899501137243. If the stated alternative points opposite the observed difference, reporting that small value as its directional p-value would be misleading. Retain the signed statistic and use an appropriate signed-tail calculation when direction matters. The function’s tails argument does not encode the direction of a hypothesis.
A p-value is not the probability that the null hypothesis is true, nor an effect size. The very small fictional sample is useful for checking arithmetic but gives weak evidence about real processes. Independence, relevant normality assumptions for small-sample inference, selection effects and measurement quality must be considered separately.
Source input filtering, errors and aliases
Type 1 requires equal matrix shapes and uses only positions where both cells are numeric. Nonnumeric pairs are skipped; a same-size range is not necessarily the same effective paired count. No retained pairs gives #VALUE!, and a zero denominator from constant paired differences gives #DIV/0!. Mismatched shapes give #N/A.
Types 2 and 3 use a different helper that excludes strings but does not uniformly filter every nonnumeric type. Do not claim that all blanks, logicals and errors are ignored identically across test types. These exercises use fully numeric data; clean and inspect ranges before applying the formulas to mixed-type records.
The wrapper applies parseInt to tails and type, then accepts tails 1/2 and types 1/2/3. Ordinary positive fractions may thus be truncated, unlike TDIST’s exact tail-count guard. Use documented integer arguments rather than depending on coercion. Invalid selections produce #NUM!; insufficient independent-sample counts produce #DIV/0!.
Modern T.TEST directly inherits TTEST’s calculation in the pinned source. This supports one combined guide, not a claim about every imported workbook or editor version. The t-probability helper uses beta functions, and floating-point cancellation in sums of squares can matter for large nearly equal data; no numerical robustness guarantee follows from the small examples.
Version, precision and verification
Checked October 18, 2026 against current official help and SDKJS tag v10.0.0.169, commit 3679e0375a758d7dc59d31337a45461be3525ed8. Introduction dates and a final supported-version endpoint are not established. Desktop Editors, Docs, mobile releases and imported files require separate compatibility checks.
Neither the ONLYOFFICE application nor its calculation engine was executed for this guide. The numerical targets are independently calculated mathematical values; code-path and error observations are manual source traces. They are not screenshots, displayed workbook results or promises of identical final digits. Use English function names and comma separators as shown, adapting separators to the editor’s locale.
Keep inputs and intermediate probabilities numeric and unrounded. Format the display rather than replacing values with rounded strings. These moderate scalar examples do not certify extreme-tail accuracy, unusual type coercion, array entry or dynamic spill. Model assumptions must be checked separately from arithmetic correctness.
References and related guides
- Official T.TEST help, checked October 18, 2026.
- Pinned function definition.
- T-probability helper, inverse solver and test calculations.
- T.DIST.
- T.DIST.2T.
- T.DIST.RT.
- T.INV.
- T.INV.2T.
- TDIST.