T.DIST Function in Google Sheets: Complete Guide
The T.DIST function returns the probability from the Student's t-distribution, a probability distribution that arises when estimating the mean of a normally distributed population with small sample...
Key Insights
- T.DIST calculates the probability from the Student’s t-distribution, essential for statistical analysis when working with small sample sizes (typically n < 30) or unknown population standard deviations.
- The function’s three variants (T.DIST, T.DIST.RT, T.DIST.2T) serve different hypothesis testing scenarios—choose based on whether you’re testing left-tailed, right-tailed, or two-tailed hypotheses.
- Combining T.DIST with AVERAGE, STDEV, and basic arithmetic lets you build complete t-test workflows directly in Google Sheets without external statistical software.
Introduction to T.DIST
The T.DIST function returns the probability from the Student’s t-distribution, a probability distribution that arises when estimating the mean of a normally distributed population with small sample sizes. William Sealy Gosset developed this distribution in 1908 while working at Guinness Brewery, publishing under the pseudonym “Student.”
Use t-distribution instead of normal distribution when your sample size is small (under 30 observations) or when you don’t know the population standard deviation. As sample size increases, the t-distribution approaches the normal distribution, but for smaller samples, the t-distribution has heavier tails—accounting for the increased uncertainty inherent in limited data.
Common applications include hypothesis testing, constructing confidence intervals, comparing means between groups, and calculating p-values in experimental research. If you’re analyzing A/B test results, comparing treatment effects, or evaluating whether a sample mean differs significantly from a hypothesized value, T.DIST is your tool.
Syntax and Parameters
The T.DIST function follows this syntax:
T.DIST(x, degrees_freedom, cumulative)
Parameter breakdown:
- x (required): The numeric value at which to evaluate the distribution. This is typically your calculated t-statistic. Accepts any real number.
- degrees_freedom (required): A positive integer representing the degrees of freedom. Must be greater than or equal to 1. For a one-sample t-test, this equals n - 1 where n is your sample size.
- cumulative (required): A logical value determining the function type. TRUE returns the cumulative distribution function (probability that a random variable is less than or equal to x). FALSE returns the probability density function.
Here’s a basic example:
=T.DIST(1.5, 10, TRUE)
This returns approximately 0.9177, meaning there’s a 91.77% probability that a t-distributed random variable with 10 degrees of freedom falls at or below 1.5.
For the probability density function:
=T.DIST(1.5, 10, FALSE)
This returns approximately 0.1118, representing the height of the probability density curve at x = 1.5.
T.DIST vs T.DIST.RT vs T.DIST.2T
Google Sheets provides three t-distribution functions, each serving different hypothesis testing scenarios:
T.DIST calculates the left-tailed probability—the area under the curve to the left of your t-value. Use this for left-tailed hypothesis tests where you’re testing if a value is significantly less than a hypothesized mean.
T.DIST.RT calculates the right-tailed probability—the area under the curve to the right of your t-value. Use this for right-tailed hypothesis tests where you’re testing if a value is significantly greater than a hypothesized mean.
T.DIST.2T calculates the two-tailed probability—the combined area in both tails. Use this when testing if a value differs significantly from a hypothesized mean in either direction.
Here’s a side-by-side comparison:
| Function | Formula | Result |
|---------------|--------------------------|----------|
| Left-tailed | =T.DIST(2, 15, TRUE) | 0.9681 |
| Right-tailed | =T.DIST.RT(2, 15) | 0.0319 |
| Two-tailed | =T.DIST.2T(2, 15) | 0.0639 |
Notice the mathematical relationships: T.DIST.RT equals 1 - T.DIST (for the cumulative version), and T.DIST.2T equals 2 × T.DIST.RT. Understanding these relationships helps you verify your calculations and choose the right function for your analysis.
=1 - T.DIST(2, 15, TRUE) // Returns 0.0319 (same as T.DIST.RT)
=2 * T.DIST.RT(2, 15) // Returns 0.0639 (same as T.DIST.2T)
Practical Applications
Calculating a P-Value for a One-Sample T-Test
Suppose you’re testing whether a new manufacturing process produces widgets with a mean weight different from the target of 50 grams. You collected 12 samples with a mean of 52.3 grams and a standard deviation of 3.1 grams.
First, calculate the t-statistic:
=( B2 - B3 ) / ( B4 / SQRT(B5) )
Where B2 is sample mean (52.3), B3 is hypothesized mean (50), B4 is sample standard deviation (3.1), and B5 is sample size (12).
This gives a t-statistic of approximately 2.57. Now calculate the two-tailed p-value:
=T.DIST.2T(ABS(B6), B5-1)
The result is approximately 0.026. Since this is less than the typical significance level of 0.05, you’d reject the null hypothesis—the new process produces widgets with a significantly different mean weight.
Determining Statistical Significance from A/B Test Data
For an A/B test comparing conversion rates, you might have control group data in column A and treatment group data in column B:
// Calculate means
=AVERAGE(A2:A101) // Control mean in C2
=AVERAGE(B2:B101) // Treatment mean in C3
// Calculate standard deviations
=STDEV(A2:A101) // Control SD in C4
=STDEV(B2:B101) // Treatment SD in C5
// Sample sizes
=COUNT(A2:A101) // n1 in C6
=COUNT(B2:B101) // n2 in C7
// Pooled standard error
=SQRT((C4^2/C6) + (C5^2/C7)) // SE in C8
// T-statistic
=(C3-C2)/C8 // t in C9
// Degrees of freedom (Welch's approximation)
=((C4^2/C6 + C5^2/C7)^2) / ((C4^2/C6)^2/(C6-1) + (C5^2/C7)^2/(C7-1)) // df in C10
// Two-tailed p-value
=T.DIST.2T(ABS(C9), C10) // p-value in C11
Working with Degrees of Freedom
Degrees of freedom represent the number of independent values that can vary in your analysis. Getting this wrong invalidates your entire statistical test.
One-sample t-test: df = n - 1
=T.DIST.2T(ABS(A2), COUNT(B2:B50)-1)
Two-sample t-test (equal variances assumed): df = n₁ + n₂ - 2
=T.DIST.2T(ABS(A2), COUNT(B2:B30)+COUNT(C2:C30)-2)
Paired t-test: df = n - 1 (where n is the number of pairs)
=T.DIST.2T(ABS(A2), COUNT(B2:B25)-1)
Welch’s t-test (unequal variances): Uses the Welch-Satterthwaite approximation shown in the previous section. This is more conservative and generally preferred when you can’t assume equal variances.
The impact of degrees of freedom is significant with small samples. Compare these p-values for the same t-statistic:
=T.DIST.2T(2.5, 5) // Returns 0.0546 (not significant at α=0.05)
=T.DIST.2T(2.5, 30) // Returns 0.0181 (significant at α=0.05)
=T.DIST.2T(2.5, 100) // Returns 0.0141 (significant at α=0.05)
With only 5 degrees of freedom, you need stronger evidence to reach statistical significance.
Common Errors and Troubleshooting
#NUM! error: Occurs when degrees_freedom is less than 1, or when x is negative and you’re using T.DIST.2T (which requires non-negative values).
=T.DIST(2, 0, TRUE) // #NUM! - df must be ≥ 1
=T.DIST.2T(-2, 10) // #NUM! - use ABS() for negative t-values
#VALUE! error: Happens when parameters aren’t numeric or when the cumulative argument isn’t a logical value.
=T.DIST("two", 10, TRUE) // #VALUE! - x must be numeric
=T.DIST(2, 10, "yes") // #VALUE! - use TRUE or FALSE
Build error-resistant formulas with IFERROR:
=IFERROR(
T.DIST.2T(ABS(A2), B2-1),
"Check inputs: t-stat in A2, sample size in B2"
)
For more robust validation:
=IF(B2<2,
"Need at least 2 observations",
IF(NOT(ISNUMBER(A2)),
"T-statistic must be numeric",
T.DIST.2T(ABS(A2), B2-1)
)
)
T.DIST Combined with Other Functions
Here’s a complete one-sample t-test workflow that takes raw data and produces a formatted result:
// Assume your data is in A2:A31 (30 observations)
// Hypothesized mean is in D2
// Sample statistics
=AVERAGE(A2:A31) // Sample mean in E2
=STDEV(A2:A31) // Sample SD in E3
=COUNT(A2:A31) // Sample size in E4
// T-test calculation
=(E2-D2)/(E3/SQRT(E4)) // T-statistic in E5
=E4-1 // Degrees of freedom in E6
=T.DIST.2T(ABS(E5), E6) // P-value in E7
// Decision at α = 0.05
=IF(E7<0.05,
"Reject null hypothesis - significant difference",
"Fail to reject null hypothesis - no significant difference"
)
For a complete two-sample t-test comparing groups in columns A and B:
// All-in-one formula for two-sample t-test p-value
=T.DIST.2T(
ABS((AVERAGE(A2:A31)-AVERAGE(B2:B31)) /
SQRT(STDEV(A2:A31)^2/COUNT(A2:A31) + STDEV(B2:B31)^2/COUNT(B2:B31))),
((STDEV(A2:A31)^2/COUNT(A2:A31) + STDEV(B2:B31)^2/COUNT(B2:B31))^2) /
((STDEV(A2:A31)^2/COUNT(A2:A31))^2/(COUNT(A2:A31)-1) +
(STDEV(B2:B31)^2/COUNT(B2:B31))^2/(COUNT(B2:B31)-1))
)
This single formula calculates the Welch’s t-test p-value. While compact, I recommend breaking it into intermediate steps for maintainability and debugging.
The T.DIST family of functions transforms Google Sheets into a capable statistical analysis tool. Master these functions, understand when to apply each variant, and you’ll handle most practical hypothesis testing scenarios without leaving your spreadsheet.