Variance Calculator

Variance Calculator

Sample & Population Variance, Std Dev, Mean

Use Sample when your data is a subset of a larger group. Use Population when you have every data point.

This calculator handles sample and population variance. Enter your numbers, pick the right type, and click Calculate.

You get variance, standard deviation, mean, and a step-by-step breakdown showing exactly how each value contributed to the result.


Population Variance vs. Sample Variance — Which Should You Use?

This is the question most people get wrong. The answer depends on what your data represents.

Sample variance (s²) is for when your dataset is a subset drawn from a larger group. Say you surveyed 50 employees out of 500 at a company. Those 50 are your sample. You use sample variance because you’re estimating the spread for the full 500. The formula divides by n-1 instead of n.

Population variance (σ²) is for when your dataset contains every value in the group. If you have test scores for all 30 students in a class and you only care about that class, those 30 scores are your population. Divide by n.

The n-1 in the sample variance is called Bessel’s correction. Without it, using your sample’s mean (instead of the true population mean) tends to underestimate variability. Subtracting 1 from the denominator corrects for that bias.

If you’re not sure which to use, go with sample variance. Most real-world data collection produces samples.


How Variance Is Calculated

The formula looks more intimidating than it is. Here’s what it actually does.

Population variance:

σ² = Σ(xᵢ - μ)² / N

Sample variance:

s² = Σ(xᵢ - x̄)² / (n - 1)

Worked Example

Say a teacher recorded quiz scores for 6 students: 72, 85, 91, 68, 79, 88.

Step 1: Find the mean

(72 + 85 + 91 + 68 + 79 + 88) / 6 = 483 / 6 = 80.5

Step 2: Calculate each deviation from the mean, then square it

ScoreDeviation (xᵢ – 80.5)Squared Deviation
72-8.572.25
85+4.520.25
91+10.5110.25
68-12.5156.25
79-1.52.25
88+7.556.25

Step 3: Sum the squared deviations

72.25 + 20.25 + 110.25 + 156.25 + 2.25 + 56.25 = 417.5

Step 4: Divide

These 6 students are a sample from a larger group, so use n-1 = 5.

  • Sample variance = 417.5 / 5 = 83.5
  • Standard deviation = √83.5 = 9.14

This tells you the typical quiz score deviates about 9 points from the class average of 80.5. That’s a moderate spread.


How to Use This Calculator

  1. Data Values: Type or paste your numbers into the text box. You can separate them with commas, spaces, or new lines. The calculator accepts any mix.
  2. Variance Type: Choose Sample if your data represents a subset of a larger population. Choose Population if you have every value in the group.
  3. Click Calculate Variance: Results appear instantly below the button.
  4. Read the Results: The four cards at the top show variance, standard deviation, mean, and count. Below that you’ll see minimum, maximum, range, and sum. The table at the bottom shows the full step-by-step breakdown for each value.

How to Interpret Your Results

Variance measures spread in squared units. If your data is in meters, variance is in meters squared. That’s why variance is rarely interpreted on its own in practice. It’s most useful for comparing datasets or for feeding into other formulas.

Standard deviation is the square root of variance and brings the units back to normal. It’s the number most people actually quote when describing spread. A standard deviation close to zero means the data is tightly clustered. A large one means the values are scattered.

The breakdown table shows you which specific values are pulling variance up. Large positive or negative deviations, once squared, contribute the most to the final number. If you see one row dominate the squared deviation column, that data point is your main driver of spread.


How to Calculate Variance in Excel

Excel has dedicated functions for both types of variance.

For sample variance, use:

=VAR.S(A1:A10)

For population variance, use:

=VAR.P(A1:A10)

To get standard deviation directly:

=STDEV.S(A1:A10)   ← sample standard deviation

=STDEV.P(A1:A10)   ← population standard deviation

These functions were introduced in Excel 2010. If you’re working in an older file or sharing with someone on an older version, the legacy functions =VAR() and =VARP() still work. VAR equals VAR.S; VARP equals VAR.P. They produce identical results, but Microsoft considers them deprecated.

One important gotcha: if your data range contains text labels, logical values (TRUE/FALSE), or error cells mixed in with numbers, VAR.S and VAR.P silently skip them. That’s usually what you want, but it can mask data entry errors. If you need Excel to count TRUE as 1 and FALSE as 0, use =VARA() or =VARPA() instead.

Also see: How to Calculate Variance in Excel?

Common Mistakes When Calculating Variance

Using population variance on sample data. If you collected data from a subset of a larger group, you need the n-1 formula. Using n will give you a slightly lower variance that underestimates the true spread of the population.

Confusing variance with standard deviation. Variance is the average squared deviation. Standard deviation is its square root. Variance is harder to interpret because of the squared units. Standard deviation is what you typically quote when describing spread.

Forgetting that variance is always non-negative. You can’t have a negative variance. If your calculation gives you a negative number, there’s an arithmetic error somewhere, usually a sign mistake in the deviation column.

Treating outliers as data errors before checking. A high variance often signals outliers. But outliers aren’t always mistakes. That one very high or very low value might be the most important data point in your set. Check before removing.

Mixing up Excel functions. VAR.S is for samples. VAR.P is for populations. Using the wrong one gives you a subtly wrong answer that won’t trigger any error message.


FAQ

What is a good variance value?

There’s no universal “good” or “bad” value. It depends entirely on the context and units of your data. A variance of 100 could mean tight clustering for test scores (out of 1000) or extreme spread for a dataset of values that should all be between 0 and 10. Always interpret variance relative to your data’s scale and domain.

Why does sample variance divide by n-1 and not n?

When you calculate the mean of a sample, that sample mean is slightly different from the true population mean. Using n in the denominator would produce a biased estimate that consistently underestimates the actual spread. Dividing by n-1 (Bessel’s correction) compensates for this and gives an unbiased estimate of the population variance.

Can variance be zero?

Yes. If every value in your dataset is identical, all deviations from the mean are zero, so the sum of squared deviations is zero, and variance is zero. This means there is no spread at all in your data.

What’s the difference between variance and standard deviation?

Variance is the average of the squared deviations from the mean. Standard deviation is the square root of variance. They both measure spread, but standard deviation is expressed in the same units as your data, making it easier to interpret in context.

Which Excel function should I use for variance?

Use =VAR.S() for sample variance and =VAR.P() for population variance. If you’re on Excel 2007 or older, =VAR() (same as VAR.S) and =VARP() (same as VAR.P) still work.

Does variance include outliers?

Yes. Variance includes every value in your dataset, and because deviations are squared, outliers have a disproportionately large effect on variance. A single extreme value can substantially increase the variance of an otherwise tight dataset. Whether that’s a problem depends on your analysis goals.

Related Articles / Calculators

I am a huge fan of Microsoft Excel and love sharing my knowledge through articles and tutorials. I work as a business analyst and use Microsoft Excel extensively in my daily tasks. My aim is to help you unleash the full potential of Excel and become a data-slaying wizard yourself.