What variance measures and why it matters
Variance is a number that tells you how spread out your data is. If all your numbers are close together, variance is small. If they're scattered far apart, variance is large. It's one of the most useful ways to understand whether your data points cluster around an average or jump all over the place.
You'll run into variance in real situations constantly. If you're tracking your monthly electric bills, variance tells you whether your usage stays steady or swings wildly. If you're comparing test scores across two classrooms, variance shows which class has more consistent performance. In manufacturing, variance reveals whether a machine produces parts reliably or with unpredictable size differences.
Variance is also the foundation for other statistics you've probably heard of—standard deviation is just the square root of variance, and many statistical tests depend on it. Learning to calculate it by hand teaches you what the number actually means, not just how to plug it into software.
Key Takeaways
- Variance measures how far your data points spread from the average, calculated by finding the average of all squared differences from the mean.
- Population variance divides by the total count of all data points, while sample variance divides by one less than the count to account for estimation uncertainty.
- The five-step process is: find the mean, subtract it from each value, square each difference, average those squares, and you have variance.
- A larger variance means data is more scattered; a variance of zero means every value is identical to the mean.
The two types of variance: population and sample
Before you calculate, you need to know which type of variance you're finding. Population variance is used when you have data for an entire group—every single data point that exists for what you're measuring. Sample variance is used when you have only a subset, a sample drawn from a larger group you're trying to understand.
The difference matters because sample variance uses a slightly different formula. When you're working with a sample, you divide by n − 1 instead of n (where n is the number of data points). This adjustment, called Bessel's correction, makes the sample variance a better estimate of the true population variance. If you use the population formula on a sample, you'll underestimate how spread out the real population is.
In practice: if you're analyzing every student's test score in one classroom, use population variance. If you're analyzing test scores from five classrooms to estimate how scores vary across the entire school district, use sample variance.
Step-by-step calculation for population variance
Here's the concrete process. Suppose you have five data points: 10, 12, 14, 16, 18.
Step 1: Find the mean (average). Add all values and divide by how many there are. (10 + 12 + 14 + 16 + 18) ÷ 5 = 70 ÷ 5 = 14.
Step 2: Subtract the mean from each data point. This gives you the difference between each value and the average:
- 10 − 14 = −4
- 12 − 14 = −2
- 14 − 14 = 0
- 16 − 14 = 2
- 18 − 14 = 4
Step 3: Square each difference. Squaring removes negative signs and emphasizes larger distances:
- (−4)² = 16
- (−2)² = 4
- (0)² = 0
- (2)² = 4
- (4)² = 16
Step 4: Find the average of the squared differences. Add them up and divide by the count: (16 + 4 + 0 + 4 + 16) ÷ 5 = 40 ÷ 5 = 8.
Your population variance is 8. That's it. The formula is: variance = Σ(x − mean)² ÷ n, where Σ means "sum of" and n is the number of data points.
Calculating sample variance with the n − 1 adjustment
Sample variance follows the same four steps, but in Step 4 you divide by n − 1 instead of n. Using the same five numbers as a sample instead of a population:
Steps 1 through 3 are identical—you still get squared differences of 16, 4, 0, 4, and 16. The sum is still 40.
Step 4 (sample version): Divide by n − 1 instead of n. Since you have 5 data points, divide by 4: 40 ÷ 4 = 10.
Your sample variance is 10, not 8. The formula is: sample variance = Σ(x − mean)² ÷ (n − 1). Notice that sample variance is always larger than population variance when calculated from the same numbers—that's by design, because a sample tends to underestimate spread.
Understanding what your variance number means
Once you have a variance, what does the number tell you? Variance is in squared units of your original data. If you're measuring heights in inches, variance is in square inches—a unit that's hard to visualize. That's why people often use standard deviation instead, which is just the square root of variance and returns you to the original units.
But variance itself is useful for comparison. If you calculate variance for two datasets, the one with the larger variance is more spread out. A variance of 8 means data is more tightly clustered than a variance of 50. A variance of zero means every single data point equals the mean—no spread at all.
Variance is also the foundation for many statistical tests. When you see phrases like "analysis of variance" (ANOVA), the test is comparing variances between groups to see if they're significantly different. Understanding variance helps you read those results.
Common mistakes to avoid
The most common error is forgetting to square the differences in Step 3. If you skip squaring and just average the raw differences from the mean, you'll always get zero—because positive and negative differences cancel out. Squaring fixes this and also makes larger deviations count more.
The second mistake is using the wrong divisor. If you have a sample, divide by n − 1. If you have the entire population, divide by n. Mixing these up will give you a number that's off by a predictable amount, but it's still wrong for your situation.
A third mistake is confusing variance with range. Range is just the difference between the highest and lowest values (18 − 10 = 8 in our example). Variance uses all the data points and their distances from the mean, so it's a much more complete picture of spread.
When to use a calculator or spreadsheet
For small datasets (under 20 points), calculating by hand teaches you what variance means. For anything larger, a spreadsheet is faster and less error-prone. In Excel or Google Sheets, use VAR.P() for population variance or VAR.S() for sample variance. In other software, look for functions labeled "variance" and check whether they use n or n − 1 in the denominator.
The advantage of knowing the manual process is that you'll spot when software gives you an unexpected answer. You'll know whether the program calculated population or sample variance, and you'll understand why the number is what it is.
Frequently Asked Questions
Why do we square the differences instead of just using absolute values?
Squaring emphasizes larger deviations more than smaller ones and eliminates negative signs without losing information about direction. It also makes variance mathematically convenient for further statistical calculations. Absolute values would work conceptually, but the resulting statistic (called mean absolute deviation) doesn't have the same mathematical properties.
Can variance be negative?
No. Because you're squaring differences, every squared term is zero or positive. The sum of squared terms is zero or positive, and dividing a non-negative number by a positive divisor gives zero or a positive result. Variance is always zero or greater.
What's the difference between variance and standard deviation?
Standard deviation is the square root of variance. If variance is 8, standard deviation is √8 ≈ 2.83. Standard deviation is easier to interpret because it's in the same units as your original data, but variance is what you calculate first and what many statistical tests actually use.
Should I use population or sample variance for my data?
Use population variance only if you have data for every single member of the group you care about. Use sample variance if your data is a subset meant to represent a larger group. When in doubt, sample variance is the safer choice because it accounts for the fact that a sample may not perfectly represent the full population.
Does the order of my data points matter?
No. Variance depends only on the values themselves and how far they are from the mean, not on the order they appear in. Rearranging your data won't change the variance at all.