T.DIST & T.INV: Student’s T‑Distribution for Hypothesis Testing

T.DIST and T.INV functions in Excel tutorial showing Student's t-distribution probability calculations critical values hypothesis testing and statistical analysis
Master the T.DIST and T.INV functions in Excel to perform statistical analysis using Student’s t-distribution. This tutorial explains the syntax, function arguments, cumulative and probability density calculations, inverse t-distribution, degrees of freedom, practical examples, and common errors. You’ll also learn how to apply these functions for hypothesis testing, confidence intervals, significance testing, quality control, and research analysis. Ideal for students, analysts, researchers, statisticians, finance professionals, and Excel users working with statistical models and inferential data analysis.

You ran a small experiment. Maybe you tested a new process on twelve samples, or surveyed fifteen customers. Now you need to know if the result is real or just chance. With a small sample, the normal curve is not quite right. It underestimates the uncertainty. The t-distribution fixes this, and Excel gives you two functions for it. T.DIST turns a t-value into a probability. T.INV turns a probability back into a t-value. Together they drive nearly every small-sample hypothesis test.

This guide explains the t-distribution in plain terms. First, it shows why small samples need it. Then it covers each function, including the one-tailed and two-tailed variants. Seven worked examples and a full troubleshooting section follow. By the end, you will be able to run a real t-test in Excel from start to finish. You will also know which function fits each situation.

Why Small Samples Need the t-Distribution

The normal curve assumes you know the true spread of the data. With a small sample, you do not. You only have an estimate. That estimate adds extra uncertainty. The t-distribution accounts for it by making the tails fatter. As a result, extreme values are treated as slightly more likely. This makes the test more cautious. It guards against false confidence from thin data. The infographic below shows the difference.

The t-distribution has fatter tails than the normal curve mean (t=0) t = +2 t-distribution normal (z) tail area = p-value Small samples use t, not z. As degrees of freedom rise, the t-curve approaches the normal. T.DIST: t-value to probability . T.INV: probability to t-value

Notice how the green t-curve sits lower in the middle and higher in the tails. This shape depends on the degrees of freedom. Specifically, degrees of freedom equal the sample size minus one. As the sample grows, the t-curve slowly becomes the normal curve.

The t-Statistic and Degrees of Freedom

Before using these functions, you need two inputs. The first is the t-statistic. It measures how far your sample mean sits from a claimed value. The second is the degrees of freedom. It reflects your sample size. Both feed directly into T.DIST and T.INV.

The core inputs: t = (sample mean - claimed mean) / (s / SQRT(n)) where: s = the sample standard deviation n = the sample size Degrees of freedom: df = n - 1 Example: mean 52, claim 50, s = 4, n = 16. t = (52 - 50) / (4 / SQRT(16)) = 2 / 1 = 2.0 df = 16 - 1 = 15

The Function Variants Explained

Excel offers several t-functions. Each answers a slightly different question. Choosing the right one depends on your test. The table below sorts them out.

FunctionWhat it returns
T.DIST(t, df, TRUE)Left-tail area up to the t-value (a probability)
T.DIST.RT(t, df)Right-tail area beyond the t-value
T.DIST.2T(t, df)Both tails combined (two-tailed p-value)
T.INV(prob, df)Left-tailed t-value for a given probability
T.INV.2T(prob, df)Two-tailed critical t-value
Quick rule: Use the 2T versions for two-tailed tests, where you care about a difference in either direction. Use RT for a one-sided test. Use the plain T.DIST with TRUE when you want a cumulative left-tail probability.

Example 1: Find a p-value from a t-Statistic

Start with the most common task. You have a t-statistic and want its p-value. A two-tailed test is typical. So you use T.DIST.2T. The result tells you how surprising your data is.

Two-tailed p-value: Your t-statistic is 2.0, with 15 degrees of freedom. =T.DIST.2T(2.0, 15) Result: about 0.0639, or 6.39%. Reading it: if the p-value is below 0.05, the result is significant. Here 0.0639 is just above 0.05. So the evidence is borderline, not quite significant at the 5% level.

Example 2: Find a Critical t-Value

Sometimes you want the threshold instead of the p-value. This is the critical t-value. You compare your t-statistic against it. T.INV.2T gives the two-tailed critical value for a chosen confidence level.

Critical value for a 95% test: For 95% confidence, alpha = 0.05, with df = 15. =T.INV.2T(0.05, 15) Result: about 2.131. How to use it: |t-statistic| > 2.131 -> significant, reject the claim. |t-statistic| < 2.131 -> not significant, keep the claim. Our t of 2.0 is below 2.131, so the result is not significant.

Example 3: A Complete One-Sample t-Test

Now put the pieces together. Suppose a supplier claims parts weigh 50 grams. You measure a small sample. You want to test the claim. Here is the full workflow in Excel.

1.
Compute the sample mean with =AVERAGE(range) and the sample standard deviation with =STDEV.S(range).
2.
Count the sample size with =COUNT(range). Then set df = n minus 1.
3.
Build the t-statistic: =(mean-50)/(s/SQRT(n)).
4.
Get the p-value: =T.DIST.2T(ABS(t), n-1). Compare it to 0.05.
Decision: If the p-value is below 0.05, the sample differs significantly from 50 grams. Otherwise, the data supports the supplier claim.

Example 4: One-Tailed Test for an Increase

Some questions have a direction. You may only care if a value went up. For instance, did a new method raise output? A drop would not interest you here. That calls for a one-tailed test. It puts all the risk in one tail. Therefore, you use the right-tailed function.

Right-tailed test: You expect an INCREASE, so you test only the upper tail. Your t-statistic is 1.9, with df = 12. =T.DIST.RT(1.9, 12) Result: about 0.0407, or 4.07%. Because 0.0407 is below 0.05, the increase is significant. Note: a one-tailed test is easier to pass, so use it only when the direction is decided in advance.

Example 5: Build a Confidence Interval

The t-distribution also builds confidence intervals for small samples. You take the sample mean. Then you add and subtract a margin. That margin uses the critical t-value. This gives a plausible range for the true mean.

A 95% confidence interval: Sample mean = 52, s = 4, n = 16, df = 15. Critical t: =T.INV.2T(0.05, 15) -> 2.131 Margin: 2.131 * (4 / SQRT(16)) = 2.131 * 1 = 2.131 Interval: 52 - 2.131 to 52 + 2.131 = 49.87 to 54.13 So you are 95% confident the true mean lies in this range.

Example 6: Compare T.DIST with the Normal Curve

It helps to see how t differs from z. For the same value, the t-distribution gives a larger tail. This reflects the extra uncertainty of a small sample. As degrees of freedom rise, the gap shrinks.

Right tail at 2.0
df = 5
df = 30
T.DIST.RT
0.0510
0.0273
Normal (z)
0.0228
0.0228

With only 5 degrees of freedom, the t tail is much larger. By 30 degrees of freedom, it is close to the normal value. Consequently, large samples can often use the simpler z approach.

Example 7: A Paired-Difference Test

A paired test compares before and after values on the same subjects. You work with the differences. Then you test whether their average differs from zero. The t-distribution handles this small-sample case well.

Before-and-after comparison: For each subject, compute: difference = after - before. Then find: mean_d = AVERAGE of the differences s_d = STDEV.S of the differences n = number of pairs, df = n - 1 t = mean_d / (s_d / SQRT(n)) p = T.DIST.2T(ABS(t), n-1) A small p-value means the change is real, not random. This is common in medical and process-improvement studies.

Troubleshooting T.DIST and T.INV

All three problems below are the most common. Each has a clear cause and a quick fix.

You get a #NUM! error

This error usually points to an out-of-range argument. T.INV and T.INV.2T need a probability between 0 and 1. A value of 0, 1, or beyond will fail. Check that first argument carefully. The degrees of freedom must also be at least 1. A value below 1 triggers the error too. Another trap is passing a negative t-value to T.DIST.2T or T.DIST.RT, which expect a non-negative input. Wrap the t-value in ABS to be safe. Once the inputs sit in their valid ranges, the error clears.

The p-value seems twice or half what you expected

This almost always means you mixed one-tailed and two-tailed functions. A two-tailed p-value is exactly double the one-tailed value for the same t. So T.DIST.2T returns twice what T.DIST.RT gives. Decide which test you actually need first. Use a two-tailed test when a difference in either direction matters. Use a one-tailed test only when the direction is set in advance. Matching the function to the test removes the factor-of-two confusion at once.

Results differ from an old TDIST formula

Older Excel used a single TDIST function with a tails argument. The newer functions split this into separate names. TDIST(x, df, 2) matches T.DIST.2T(x, df). TDIST(x, df, 1) matches T.DIST.RT(x, df). If you are updating an old workbook, map each call to its modern equivalent carefully. The legacy TDIST still works for compatibility, but the newer functions are clearer. Confirming which version a formula uses explains most differences between old and new sheets.

Frequently Asked Questions

  • When should I use the t-distribution instead of the normal distribution?+
    Use the t-distribution when your sample is small and you do not know the true population standard deviation, which is the usual situation in real testing. Because you estimate the spread from the sample itself, there is extra uncertainty, and the t-distribution accounts for it with fatter tails. As a rough guide, samples under about 30 clearly benefit from the t approach. As the sample size grows, the t-distribution gradually becomes the normal distribution, so for large samples the two give almost identical results and either can be used.
  • What is the difference between T.DIST, T.DIST.RT, and T.DIST.2T?+
    All three work with the t-distribution but return different areas. T.DIST with the cumulative argument TRUE gives the left-tail area up to your t-value. T.DIST.RT gives the right-tail area beyond your t-value, which suits a one-sided test looking for an increase. T.DIST.2T gives the combined area in both tails, which is the two-tailed p-value used when a difference in either direction matters. The two-tailed result is always exactly double the one-tailed result for the same t-value, so choosing the right function depends entirely on the test you are running.
  • How do I find a critical t-value for a hypothesis test?+
    Use T.INV.2T for a two-tailed test or T.INV for a one-tailed test. For a 95% confidence level, the alpha is 0.05, so =T.INV.2T(0.05, df) returns the two-tailed critical value, where df is your degrees of freedom. You then compare the absolute value of your t-statistic against this critical value. If your t-statistic exceeds the critical value, the result is statistically significant and you reject the null hypothesis. If it falls below, the result is not significant. The critical value acts as the threshold your evidence must cross.
  • What are degrees of freedom in a t-test?+
    Degrees of freedom reflect how much independent information your sample contains for estimating variability. For a simple one-sample t-test, the degrees of freedom equal the sample size minus one, because one value is effectively used up when you estimate the mean. So a sample of 16 has 15 degrees of freedom. This number shapes the t-distribution: fewer degrees of freedom produce fatter tails and a more cautious test, while more degrees of freedom produce a curve closer to the normal distribution. You pass the degrees of freedom directly into T.DIST and T.INV as an argument.