Variance Calculator in Excel: Step-by-Step Guide
In this article
You can calculate variance in Excel with a single formula: =VAR.S(range) for a sample of data or =VAR.P(range) for an entire population. Type your numbers into a column, point the formula at that range, and Excel returns the variance instantly. The rest of this guide covers which function to choose, how to build a reusable variance calculator, and how to read the number you get back.
What You'll Need
- Microsoft Excel (desktop, Excel for the web, or the mobile app). The steps below use the desktop ribbon; the formula names are identical everywhere.
- A list of numeric values in a single column or row, with no blanks or text inside the range.
- A rough idea of whether your data is a sample (part of a larger group) or a population (the complete group). This decides which function to use.
Step-by-Step
- Enter your data. Put each number in its own cell, for example A2 through A11 for ten values. Use one column per dataset so the ranges stay easy to read. Delete any stray spaces or notes inside the range; text cells are ignored by the variance functions but blank cells shift what counts as a value.
- Decide sample versus population. If your numbers are every member of the group you care about (all scores in one class, all readings from one sensor session), use the population function. If they are a subset you are using to estimate a bigger group (a dozen customers out of thousands), use the sample function. When unsure, sample is the safer default, because sample variance is the unbiased estimator and it produces the larger, more conservative figure.
- Click an empty cell where you want the answer, ideally a few rows below your data with a label beside it such as "Variance".
- Type the formula. For a sample enter =VAR.S(A2:A11). For a population enter =VAR.P(A2:A11). Press Enter. Do not type the curly braces you may see in older tutorials; those belong to array formulas and are entered differently.
- Check the result direction. Variance is in squared units, so it will look larger than your data. If your values range from 10 to 20, a variance of 9 is plausible; a variance of 900 is a red flag that something is off. Compare against the standard deviation, which is the square root of variance: =STDEV.S(A2:A11) should equal the square root of your variance figure.
- Add a standard deviation cell for readability. In the cell below, enter =STDEV.S(A2:A11). Standard deviation is in the same units as the original data, so it is usually the number you quote in a report, with variance kept as the working figure.
- Make it reusable. Select the two formula cells, drag the fill handle (the small square at the bottom-right corner of the selection) across to the next column, and Excel adjusts the references for the adjacent dataset automatically. Label each column above so the output stays legible.
- Round the display without changing the value. Use the Decrease Decimal button on the Home tab in the Number group, or wrap the formula in =ROUND(VAR.S(A2:A11),2). Formatting only changes what you see; ROUND changes the stored value, so prefer formatting if you will reuse the cell.
- Optional: use the Analysis ToolPak for a full statistics block. Go to File > Options > Add-ins, choose Excel Add-ins in the Manage box and click Go, tick Analysis ToolPak, and click OK. Then on the Data tab click Data Analysis, choose Descriptive Statistics, select your range, and tick Summary statistics. You get variance, standard deviation, mean and count in one table. Labels in these dialogs vary slightly between Excel versions, so if a wording looks different from what is described here, look for the closest match.
- Verify by hand once. For a small set, confirm your formula on a second sheet: compute the mean with =AVERAGE(range), subtract the mean from each value in a helper column, square each result, then divide the sum of squares by n−1 for a sample or n for a population. Matching your formula output proves the range you selected is the range you meant.
Common Mistakes
Mixing sample and population functions. VAR.S divides by n−1 and VAR.P divides by n, so on the same data VAR.S is always slightly larger. Using one in place of the other is not an error in Excel, just in interpretation, and the gap matters most on small datasets.
Including labels in the range. If your range includes a header row, Excel ignores the text cell, but a cell containing a number stored as text (often aligned to the left) is also skipped, quietly shrinking your sample.
Using the legacy VAR or VARP functions. These still work for backward compatibility, but VAR is sample variance and VARP is population variance under confusing names. Use VAR.S and VAR.P so anyone reading the sheet knows which is which.
Comparing variances across different units. A variance of 25 means nothing on its own: 25 for minutes is not comparable to 25 for kilograms. To compare spread across datasets with different units or wildly different means, use the coefficient of variation instead, which is standard deviation divided by the mean.
Leaving blanks mid-range. A blank cell in a selected range is simply skipped, so ten rows with two blanks is treated as eight data points. Fill gaps or shrink the range deliberately.
Tips
- Name your range (Formulas > Define Name) such as Readings, then write =VAR.S(Readings). Named ranges survive inserted rows and are far easier to audit.
- Press Ctrl + ` (the grave accent key) to toggle showing formulas instead of results, which makes it easy to spot a wrong range reference before you share the file.
- Use Alt + = to insert an AutoSum, then change the function name in the formula bar if you need variance nearby.
- Keep the raw data on its own sheet and put all formulas on a summary sheet. It prevents accidental edits to the numbers your results depend on.
- If your data is filtered, remember that VAR.S includes hidden rows. For filtered-only results, use SUBTOTAL or AGGREGATE rather than the plain variance functions.
- Excel for the web supports VAR.S and VAR.P, so a shared workbook keeps working, but the Analysis ToolPak is a desktop-only add-in.
Troubleshooting
#DIV/0! appears. This means the range contains fewer than two numeric values for VAR.S, or is empty for VAR.P. Widen the range or check that the cells really hold numbers.
#VALUE! appears. A cell in the range contains text that Excel cannot coerce, or a reference is malformed. Select the range and look for entries like "N/A" or numbers typed with a trailing space.
The number looks far too large. You likely included a total row, a percentage, or a summary cell at the bottom of the data. Trim the range to the raw observations only.
The number is zero. Every value in the range is identical, which is genuine: no spread, no variance. Confirm you did not accidentally select a single repeated cell.
The result changes when you sort or filter. Sorting with whole rows selected should not change the answer; if it does, some formulas point at fixed cells instead of the range. For sorting and filtering, convert the data to a Table with Ctrl + T so references stay consistent.
The Data Analysis button is missing. The Analysis ToolPak is not enabled or it is a web or mobile edition. Enable it via File > Options > Add-ins on desktop; on Excel for the web, use the formulas instead.
If none of that explains it, rebuild the calculation on a clean sheet with a handful of values you can verify by hand. That isolates whether the problem is the formula or the data.
Frequently Asked Questions
What is the difference between VAR.S and VAR.P?
VAR.S estimates variance from a sample and divides the sum of squared deviations by n−1. VAR.P calculates the variance of a complete population and divides by n. Use VAR.S when your data is a subset of a larger group.
Can I calculate variance in Excel for the web or on my phone?
Yes. VAR.S, VAR.P, STDEV.S and STDEV.P work in Excel for the web and in the mobile apps. The Analysis ToolPak add-in is only in the desktop application.
Why is my variance higher than my standard deviation?
Variance is in squared units, so it is almost always a larger number than the standard deviation unless the spread is very small. That is expected, not a mistake.
How do I calculate variance across several columns at once?
Point the formula at the whole block, such as =VAR.S(A2:D11), if all the values belong to one group. If each column is a different group, use one formula per column.
Does Excel have a function for variance of a percentage?
No special function is needed. Store percentages as decimals or as percentage-formatted numbers and use VAR.S or VAR.P on them normally, then format the result the way you want it displayed.