Excel has two variance functions built in, and which one you use depends on whether your data is a sample or a complete population

If your numbers represent a sample drawn from a larger group, use VAR.S (or the older VAR function). If your numbers are the entire population you're measuring, use VAR.P (or VARP). The difference matters: sample variance uses a slightly larger divisor to account for the fact that a sample tends to underestimate spread, while population variance divides by the exact count of your data points.

In most real-world situations — survey responses, test scores from one class, monthly sales figures — you're working with a sample, so VAR.S is the right choice. Population variance is less common and applies when you have data for every single member of the group you're studying.

Key Takeaways

  • Use VAR.S when your data is a sample from a larger group; use VAR.P when your data represents the entire population.
  • Type =VAR.S(A1:A10) into any cell to calculate sample variance for the range A1 through A10.
  • Variance measures how spread out your numbers are — higher variance means the numbers are more scattered, lower variance means they cluster closer together.
  • Excel ignores text and empty cells in the range you select, but includes zero values in the calculation.

The difference between VAR.S and VAR.P

Sample variance (VAR.S) divides the sum of squared differences by n minus 1, where n is the count of your data points. Population variance (VAR.P) divides by n itself. This difference is small when you have many data points but becomes noticeable with smaller datasets.

Think of it this way: if you measure the height of 10 people in a room, those 10 people are a sample of all people everywhere. Sample variance accounts for the fact that your 10 measurements probably don't capture the full range of human height. If instead you measure the height of every person in a specific family of 5, those 5 people are your entire population, and you use population variance.

In practice, most spreadsheet work involves samples. You're analyzing a subset of customers, a portion of a year's data, or responses from a survey group. VAR.S is the safer default choice unless you have a specific reason to believe your data is complete.

How to enter the variance formula

Click the cell where you want the variance to appear. Type =VAR.S( and then select the range of cells containing your numbers. You can click and drag to highlight them, or type the range directly — for example, =VAR.S(B2:B50). Close the parenthesis and press Enter.

Excel will calculate the variance and display the result in that cell. The number you see represents the average of the squared distances from the mean. Because the differences are squared, variance is always in squared units of your original data — if you're measuring weight in pounds, variance is in pounds squared.

You can also type the range by hand without selecting it. =VAR.S(A1:A100) works just as well as clicking and dragging. If your data is scattered across non-adjacent cells, separate each range with a semicolon: =VAR.S(A1:A10;C1:C10).

What happens with empty cells, text, and zeros

Excel ignores empty cells and cells containing text when calculating variance. If you have a range with some blank spaces or labels mixed in, VAR.S skips over them and counts only the numeric values. This means you don't need to clean up your data before using the function — just select the whole range including any gaps.

Zero values, however, are included in the calculation. If your data contains actual zeros (like zero sales on a particular day), they count as numbers and affect the variance. This is usually what you want, but it's worth knowing the difference between a blank cell, which is ignored, and a cell containing 0, which is not.

Understanding what the variance number means

Variance tells you how spread out your data is. A variance of 0 means every number in your range is identical. A larger variance means the numbers are more scattered. Variance of 25 is larger than variance of 4, so the first dataset is more spread out than the second.

Because variance squares the differences, it's harder to interpret than standard deviation (which is the square root of variance). If you want a number in the same units as your original data, calculate standard deviation instead using STDEV.S or STDEV.P. But variance itself is useful for statistical tests and comparisons between datasets.

For example, if you're comparing the consistency of two manufacturing processes, the one with lower variance is more consistent. If you're looking at test scores, higher variance means students' scores are more spread out; lower variance means scores cluster closer to the average.

Common mistakes when using variance functions

The most frequent error is using VAR.P when you should use VAR.S, or vice versa. If you're unsure, VAR.S is almost always correct for real-world data. Another mistake is including headers or labels in your range — if your first row says "Sales" and you select A1:A100, Excel will skip the text in A1 and calculate variance for A2:A100, which is usually fine but can be confusing if you're not expecting it.

Mixing VAR with VAR.S or VAR.P can also cause confusion. The older VAR function is equivalent to VAR.S, and VARP is equivalent to VAR.P. Microsoft still supports these older names for backward compatibility, but the newer names are clearer about what they do. Stick with VAR.S and VAR.P in new spreadsheets.

Variance in context: sample calculations

Suppose you have five test scores: 85, 90, 78, 92, and 88. The mean is 86.6. The squared differences from the mean are 2.56, 10.89, 73.96, 28.09, and 1.69. The sum of these squared differences is 117.19. Sample variance divides by 4 (n minus 1), giving 29.3. Population variance would divide by 5, giving 23.4.

In Excel, you would enter =VAR.S(A1:A5) if those scores are in cells A1 through A5, and the result would be approximately 29.3. If you used =VAR.P(A1:A5) instead, you'd get approximately 23.4. The difference shrinks as your dataset grows larger, but for small samples it's meaningful.

Frequently Asked Questions

Should I use VAR.S or VAR.P for my data?

Use VAR.S unless your data represents every single member of the group you're studying. For surveys, samples, test scores from one class, or any subset of a larger population, VAR.S is correct. VAR.P is rare in practice and applies only when you have complete data for an entire defined population.

What's the difference between variance and standard deviation?

Standard deviation is the square root of variance and is expressed in the same units as your original data, making it easier to interpret. If variance is 25, standard deviation is 5. For most purposes, standard deviation is more intuitive, but variance is used in statistical formulas and comparisons.

Why does Excel ignore empty cells in my range?

Excel treats empty cells as non-data and skips them. This lets you select a large range without worrying about blank rows or columns. If you want to include a zero value, enter 0 in the cell instead of leaving it empty — zeros are counted in the calculation.

Can I calculate variance for non-numeric data?

No. Variance measures spread in numbers, so text, dates, and other non-numeric values cannot be used. Excel will ignore them if they're mixed into a range with numbers, but you cannot calculate variance for text alone.

What if my data is in multiple separate columns?

You can include multiple ranges in one formula by separating them with semicolons: =VAR.S(A1:A10;C1:C10). This calculates variance across all the numbers in both ranges as if they were one dataset. Make sure you're using semicolons, not commas, depending on your regional Excel settings.