F.DIST & F.INV: F‑Distribution for ANOVA & Variance Analysis

F.DIST and F.INV functions in Excel tutorial showing F-distribution probability calculations critical values ANOVA hypothesis testing and statistical analysis
Master the F.DIST and F.INV functions in Excel to analyse data using the F-distribution. This tutorial explains the syntax, function arguments, cumulative and probability density calculations, inverse F-distribution, degrees of freedom, practical examples, and common errors. You’ll also learn how to apply these functions for ANOVA, variance comparison, hypothesis testing, confidence intervals, and statistical modelling. Ideal for students, analysts, researchers, statisticians, finance professionals, and Excel users working with inferential statistics and advanced data analysis.

You have three machines, three suppliers, or three teams. Their average outputs look different. But are they really different, or is it just noise? A plain comparison of means will not settle it. You need to weigh the spread within each group against the spread between them. That is exactly what the F-distribution does. Excel exposes it through F.DIST and F.INV. These functions power the F-test and the whole method of ANOVA.

This guide explains the F-distribution without heavy maths. First, it shows what an F-ratio means. Then it covers each function variant. Seven practical examples cover variance comparison and ANOVA, followed by a full troubleshooting section. By the end, you will read an ANOVA table with confidence. You will also know how to verify every number in it yourself.

What the F-Distribution Measures

The F-distribution describes a ratio of two variances. In short, it compares how spread out two things are. Because it is a ratio of squared values, it can never be negative. It starts at zero and stretches to the right. This gives it a distinctive skewed shape. The infographic below shows the curve and its reject region.

The F-distribution: a right-skewed ratio of two variances critical F 0 reject region (right tail) F = variance 1 / variance 2 Values start at 0 and cannot be negative (a ratio of squares). The F-test asks: are these two variances different, or is the ratio close to 1? F.DIST: F-value to probability . F.INV: probability to F-value . two df values shape the curve

When two variances are equal, the ratio sits near 1. A ratio far above 1 suggests a real difference. A ratio near 1 suggests none. Notably, the exact shape depends on two separate degrees of freedom. One comes from the top of the ratio, the other from the bottom. This two-part shape is what sets F apart from the t-curve.

The Two Degrees of Freedom

Unlike the t-distribution, the F-distribution needs two degrees of freedom. The first belongs to the numerator variance. The second belongs to the denominator variance. Both feed into every F function. Getting them in the right order matters.

The F-ratio and its two df values: F = variance_1 / variance_2 df1 = numerator degrees of freedom (top variance) df2 = denominator degrees of freedom (bottom variance) For comparing two samples: df1 = n1 - 1 (first group size minus one) df2 = n2 - 1 (second group size minus one) Always place the larger variance on top, so F is >= 1. That keeps the test in the right tail.

The Function Variants Explained

Excel offers several F functions. Each returns a different part of the distribution. Choosing the right one depends on your question. The table below lays them out.

FunctionWhat it returns
F.DIST(x, df1, df2, TRUE)Left-tail cumulative probability up to x
F.DIST.RT(x, df1, df2)Right-tail probability beyond x (the p-value)
F.INV(prob, df1, df2)Left-tailed F-value for a probability
F.INV.RT(prob, df1, df2)Right-tailed critical F-value
F.TEST(array1, array2)A two-tailed p-value comparing two variances directly
Most-used pair: For an F-test you usually want F.DIST.RT to get a p-value, and F.INV.RT to get the critical value. The right tail is where significance lives, because a large F means a real difference.

Example 1: Get a p-value from an F-Ratio

Start with the core task. You have an F-ratio and want its p-value. The right-tail function gives it directly. A small p-value means the variances truly differ.

Right-tail p-value: Your F-ratio is 3.5, with df1 = 4 and df2 = 20. =F.DIST.RT(3.5, 4, 20) Result: about 0.0256, or 2.56%. Because 0.0256 is below 0.05, the difference is significant. The variances (or group means, in ANOVA) are not all equal.

Example 2: Find a Critical F-Value

Sometimes you want the threshold instead. This is the critical F-value. You compare your F-ratio against it. F.INV.RT returns it for a chosen significance level.

Critical value at 5%: For alpha = 0.05, with df1 = 4 and df2 = 20: =F.INV.RT(0.05, 4, 20) Result: about 2.866. How to use it: F-ratio > 2.866 -> significant, reject equal variances. F-ratio < 2.866 -> not significant, keep them equal. Our F of 3.5 exceeds 2.866, so it is significant.

Example 3: Compare Two Variances

A common use is testing whether two processes vary by the same amount. Consistency often matters as much as the average. A machine with steady output beats an erratic one. You take a sample from each. Then you form the ratio of their variances. The F-test tells you if the difference is real.

1.
Find each sample variance with =VAR.S(range). Put the larger one on top.
2.
Form the ratio: =larger_variance / smaller_variance.
3.
Set df1 and df2 as each sample size minus one.
4.
Get the p-value: =F.DIST.RT(ratio, df1, df2).
Shortcut: The F.TEST function does this in one step. Just give it the two data ranges, and it returns a two-tailed p-value for equal variances.

Example 4: The F-Test Behind One-Way ANOVA

ANOVA compares several group means at once. Testing each pair separately would inflate the error rate. ANOVA avoids that with a single test. It works by splitting the total variation into two parts. One part is variation between groups. The other is variation within groups. The F-ratio compares them. A large ratio points to a genuine group effect.

The ANOVA F-ratio: F = MS_between / MS_within where: MS_between = variation among the group means MS_within = variation inside each group (the noise) The idea: If groups truly differ, between-variation is large. The F-ratio grows, and the p-value shrinks. A p-value below 0.05 means at least one group differs. Get the p-value with: =F.DIST.RT(F, df_between, df_within)

Example 5: Read the ANOVA Table Output

Excel can run ANOVA through the Analysis ToolPak. The output includes an F value and its p-value. Knowing the functions helps you read and verify that table. Here is how the pieces connect.

Source
F
P-value
Between groups
5.2
0.011
Within groups

Here the F value is 5.2 and the p-value is 0.011. Because 0.011 is below 0.05, the group means differ significantly. You can confirm the p-value yourself with F.DIST.RT using the two df values from the table.

Example 6: Compare Critical Values Across df

The critical F-value shifts as degrees of freedom change. Larger samples give smaller critical values. This means bigger studies detect smaller differences. In other words, more data raises the power of the test. Seeing the pattern helps you plan a test. It shows why sample size is worth the effort.

df1 = 3
df2 = 10
df2 = 40
Critical F (5%)
3.71
2.84

With more denominator degrees of freedom, the critical value drops from 3.71 to 2.84. Therefore, a larger within-group sample makes the test more sensitive. This is a useful fact when designing experiments.

Example 7: A Safety Check Before an F-Test

A tidy model tests its inputs first. The F-test needs positive variances and valid degrees of freedom. Wrapping the logic in a check prevents confusing errors. This keeps a shared workbook clean.

A guarded F-test: =IF(OR(VAR.S(A:A)=0, VAR.S(B:B)=0), "A group has no variation - cannot run F-test", F.DIST.RT(VAR.S(A:A)/VAR.S(B:B), COUNT(A:A)-1, COUNT(B:B)-1)) How it behaves: Zero variance in a group -> a clear warning. Valid data -> returns the p-value. This avoids a divide-by-zero and explains the problem plainly.

Troubleshooting F.DIST and F.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 points to an invalid argument. The x value in F.DIST must not be negative, because an F-ratio is always zero or positive. Check for a negative or wrongly calculated ratio. For F.INV and F.INV.RT, the probability must sit between 0 and 1. A value of 0, 1, or beyond fails. Both degrees of freedom must also be at least 1. Confirm df1 and df2 are whole positive numbers. Once every argument sits in its valid range, the error disappears.

The two degrees of freedom are swapped

Order matters with the F-distribution, and swapping df1 and df2 gives a wrong answer. The first degrees of freedom belong to the numerator variance, the one on top of the ratio. The second belong to the denominator variance. If your result looks off, check that each df matches its own variance. A common slip is pairing the numerator df with the denominator variance. Line up each variance with its own degrees of freedom, and the calculation returns the correct probability.

Results differ from an old FDIST formula

Older Excel used FDIST, which returned the right-tail probability directly. The modern F.DIST returns the left-tail cumulative value instead when the cumulative argument is TRUE. So FDIST(x, df1, df2) matches F.DIST.RT(x, df1, df2), not plain F.DIST. When updating an old workbook, map each legacy call to the correct new function. The difference is not an error but a change in which tail the function reports. Matching the tail explains almost every discrepancy between old and new sheets.

Frequently Asked Questions

  • What is the F-distribution used for?+
    The F-distribution is used to compare variances, which makes it central to analysis of variance, or ANOVA. It describes the ratio of two variances, so it answers whether two or more groups spread out or differ by the same amount. In ANOVA, the F-ratio compares the variation between group means against the variation within the groups. A large ratio, and therefore a small p-value, means at least one group truly differs from the others. It also underlies simple two-sample variance comparisons and regression significance tests, wherever a ratio of variances needs a probability.
  • Why does the F-distribution need two degrees of freedom?+
    Because the F-statistic is a ratio of two variances, each variance brings its own degrees of freedom. The first, df1, belongs to the numerator variance on top of the ratio. The second, df2, belongs to the denominator variance on the bottom. Together they define the exact shape of the curve. For a two-sample comparison, each equals its sample size minus one. In ANOVA, df1 comes from the number of groups minus one, and df2 comes from the total sample size minus the number of groups. Always keep each df matched to its own variance.
  • Should I use F.DIST or F.DIST.RT for an F-test?+
    For a standard F-test you almost always want F.DIST.RT, which returns the right-tail probability, or p-value, beyond your F-ratio. Significance lives in the right tail because a large F-ratio signals a real difference in variances or means. Plain F.DIST with the cumulative argument TRUE returns the left-tail area instead, which is the probability up to your value rather than beyond it. To get the critical threshold for a chosen significance level, use F.INV.RT. Matching the right-tail functions to the right-tail logic of the test keeps your p-values and critical values consistent.
  • How is the F-test related to ANOVA in Excel?+
    ANOVA is essentially a structured F-test across several groups. It splits the total variation into between-group and within-group parts, then forms an F-ratio by dividing the between-group mean square by the within-group mean square. Excel can run this automatically through the Analysis ToolPak, producing a table with an F value and its p-value. Behind that output sits the same F-distribution that F.DIST.RT uses. You can verify the reported p-value yourself with =F.DIST.RT(F, df_between, df_within), using the degrees of freedom shown in the ANOVA table.