T.TEST Function (LibreOffice Calc)

Math Advanced LibreOffice Calc Introduced in LibreOffice 4.0
hypothesis-testing statistics t-test inferential-statistics probability experimental-analysis

The T.TEST function in LibreOffice Calc performs Student’s t-tests for comparing means. This guide explains syntax, test types, tails, examples, errors, and best practices.

Compatibility

What the T.TEST Function Does

  • Compares means between two datasets
  • Supports paired, equal variance, and unequal variance tests
  • Returns the probability (p-value) of observing the difference in means
  • Works across sheets
  • Essential for scientific experiments, A/B tests, and inferential statistics

T.TEST answers:

“If the two groups truly had equal means, what is the probability of observing a difference this large?”

Syntax

T.TEST(array1; array2; tails; type)

Where:

  • array1 — first sample
  • array2 — second sample
  • tails — 1 for one-tailed, 2 for two-tailed
  • type — type of t-test:
    • 1 = paired t-test
    • 2 = two-sample equal variance (homoscedastic)
    • 3 = two-sample unequal variance (heteroscedastic, Welch’s test)
Most real-world data uses type = 3 (unequal variance).

Choosing the Right Test Type

Type Name When to Use
1 Paired t-test Before/after measurements, matched subjects
2 Two-sample equal variance Rare; only when variances are statistically equal
3 Two-sample unequal variance Default for independent groups

Basic Examples

Two-tailed, unequal variance (most common)

=T.TEST(A1:A30; B1:B30; 2; 3)

One-tailed, unequal variance

=T.TEST(A1:A30; B1:B30; 1; 3)

Paired t-test (before/after)

=T.TEST(Before; After; 2; 1)

Equal variance test (rare)

=T.TEST(A1:A30; B1:B30; 2; 2)

Across sheets

=T.TEST(Sheet1.A1:A50; Sheet2.B1:B50; 2; 3)

Advanced Examples

T-test ignoring errors

=T.TEST(IF(ISNUMBER(A1:A100); A1:A100); IF(ISNUMBER(B1:B100); B1:B100); 2; 3)

(Confirm with Ctrl+Shift+Enter in older Calc.)

T-test using filtered (visible) data only

Use SUBTOTAL helper column to filter values before passing to T.TEST.

T-test after removing outliers

=T.TEST(FILTER(A1:A100; A1:A100<1000); FILTER(B1:B100; B1:B100<1000); 2; 3)

T-test for A/B testing

=T.TEST(VariantA; VariantB; 2; 3)

T-test for scientific experiments

=T.TEST(ControlGroup; TreatmentGroup; 2; 3)

T-test for standardized data

=T.TEST(STANDARDIZE(A1:A30; MeanA; SDA); STANDARDIZE(B1:B30; MeanB; SDB); 2; 3)

How T.TEST Calculates the p-value

  1. Compute sample means and variances
  2. Compute t-statistic:

[ t = \frac{\bar{x}_1 - \bar{x}_2}{\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}} ]

  1. Compute degrees of freedom (Welch-Satterthwaite for type 3)
  2. Compute p-value using the t-distribution CDF
  3. Adjust for one-tailed or two-tailed test

Interpretation of T.TEST Results

p-value Meaning
< 0.05 Statistically significant difference
< 0.01 Strong evidence of difference
< 0.001 Very strong evidence
> 0.05 No significant difference

Common Errors and Fixes

Err:502 — Invalid argument

Occurs when:

  • Arrays contain no numeric values
  • Arrays have different lengths (for paired test)
  • tails not 1 or 2
  • type not 1, 2, or 3

Err:504 — Parameter error

Occurs when:

  • Semicolons are incorrect
  • Range references malformed

T.TEST returns unexpected value

Possible causes:

  • Wrong test type
  • Wrong tail selection
  • Outliers affecting means
  • Non-normal data (t-test assumes approximate normality)

Best Practices

  • Use type = 3 unless you have strong evidence of equal variances
  • Use type = 1 for before/after or matched subjects
  • Use two-tailed unless you have a directional hypothesis
  • Remove outliers before testing
  • Use named ranges for cleaner formulas
  • Use F.TEST to check variance equality (optional)
T.TEST is the backbone of inferential statistics — perfect for experiments, A/B tests, scientific research, and any situation where you need to know whether two groups truly differ.

Copyright 2026. All rights reserved.