VAR.S Excel: How to Calculate Sample Variance
In this article
VAR.S in Excel returns the sample variance of a set of numbers — the measure of how spread out your data is when the values are a sample drawn from a larger population. You type =VAR.S(number1, [number2], ...) into a cell, point it at your data, and Excel does the rest. The key reason to use VAR.S rather than VAR.P is the denominator: VAR.S divides by n−1 (Bessel's correction), which gives an unbiased estimate when your data is only a sample. If you truly have the whole population, use VAR.P instead.
What You'll Need
- Microsoft Excel 2010 or later (VAR.S replaced the older VAR function, which still works but is kept only for compatibility). Excel for the web, Excel for Mac, and Microsoft 365 all include it.
- Your numbers typed into cells, ideally in a single column or row with no blanks inside the range.
- A clear idea of whether your data is a sample or the full population, because that decides between VAR.S and VAR.P.
Menu labels and function names can differ slightly by version, platform and region, but the formula syntax below is the same everywhere Excel runs.
Step-by-Step
- Lay out your data. Put each observation in its own cell — for example, A2 through A11 for ten readings. Avoid merging cells or leaving empty rows in the middle of the range, since blank cells are skipped and text is ignored by VAR.S, which can quietly change your result.
- Check the data type. VAR.S only counts numeric values. Numbers stored as text (common when data is pasted from another system) are ignored, not converted. To spot them, look for values aligned to the left rather than the right of the cell.
- Click the result cell where you want the variance to appear, somewhere outside your data range.
- Type the formula. Start with
=VAR.S(, then select your range with the mouse or type it, then close the bracket. A finished formula looks like=VAR.S(A2:A11). Press Enter. - Add more arguments if your data is split up. VAR.S accepts up to 254 arguments, so you can write
=VAR.S(A2:A11, C2:C11)if two separate blocks belong to the same sample. - Read the answer. The result is in squared units — if your data is in dollars, the variance is in squared dollars. Most people take the square root to get the standard deviation, using
=STDEV.S(A2:A11)or=SQRT(VAR.S(A2:A11)). - Cross-check the count. Put
=COUNT(A2:A11)in a nearby cell. VAR.S needs at least two numeric values; if COUNT returns 1 or 0, the formula will show an error. - Decide between VAR.S and VAR.P deliberately. Use VAR.S when the rows are a sample of a bigger group (a survey of some customers, a week of sensor readings). Use VAR.P when the range is every value that exists (all four quarterly totals for the year). The two answers will differ, and VAR.S is always slightly larger.
Common Mistakes
- Using VAR.S on a full population. It overstates spread slightly because it divides by n−1. For a complete set, VAR.P is the correct choice.
- Assuming blanks and text count as zero. They do not — they are skipped. But a cell containing the text
0typed as text, or a formula returning an empty string, can be handled inconsistently. Clean the range first. - Including header rows or totals. A range like A1:A11 that includes the label "Reading" and a sum row will skew or error. Select only the actual observations.
- Confusing variance with standard deviation. Variance is squared; standard deviation is in the original units. Reporting variance as if it were in dollars is a common slip.
- Ignoring logical values. VAR.S ignores TRUE/FALSE in cell references, while VARA includes them (TRUE becomes 1, FALSE becomes 0). Pick the one that matches your intent.
- Typing the range by hand with a typo. A wrong range gives a plausible but wrong answer. Click-drag instead, and glance at the highlighted cells.
Tips
- Use a named range or an Excel Table (Insert > Table) so the formula stays correct as rows are added.
- Round only for display: set the cell format rather than wrapping the formula in ROUND, so downstream calculations keep full precision.
- If you need to compare several groups, put VAR.S in a helper column next to each group's data and build a small summary table rather than one giant formula.
- Keep a note beside the formula stating sample or population — future readers of the sheet will thank you.
- In Excel for the web the function works the same, but very large ranges recalculate more slowly than on the desktop app.
Troubleshooting
You see #DIV/0!. Fewer than two numeric values were found in the range. Check with COUNT and confirm the cells really contain numbers, not text.
You see #VALUE!. An argument is text that cannot be interpreted as a number, such as a stray label typed directly into the formula rather than referenced from a cell. Remove it or reference the cell instead.
You see #NAME?. The function name is misspelled or the file is in an Excel version older than 2010, which does not know VAR.S. Use the legacy VAR function there.
The answer looks wrong. Recheck the range boundaries, look for hidden rows inside the range, and confirm whether the data is a sample or a population.
The formula won't update. Calculation may be set to Manual. Go to the Formulas tab and set Calculation Options back to Automatic.
The result suddenly changes. Something inside the range was edited or a source cell now contains text. Compare COUNT before and after.
If that did not work
Copy the numbers into a clean sheet in a single column with no blanks, apply VAR.S to that fresh range, and compare the two results. This isolates whether the problem is the data or the formula.
Frequently Asked Questions
What is the difference between VAR.S and VAR.P?
VAR.S divides the sum of squared deviations by n−1 and estimates variance from a sample. VAR.P divides by n and describes a complete population. Use VAR.S unless you have every value in the group.
Does VAR.S ignore text and blank cells?
Yes. Text, blanks, and logical values inside referenced ranges are skipped. Logical values and text representations of numbers typed directly into the formula as arguments are counted.
Why is my VAR.S result bigger than VAR.P?
Because of the n−1 denominator. Dividing by a smaller number produces a larger figure, which is the intended correction for sampling.
Can I use VAR.S across non-adjacent ranges?
Yes. Separate each range with a comma, as in =VAR.S(A2:A11, D2:D11). All values must belong to the same sample.
Is VAR.S the same as the old VAR function?
Functionally yes — VAR remains only for backward compatibility. New sheets should use VAR.S, which is clearer about being the sample version.
How do I get standard deviation instead?
Use STDEV.S for a sample or STDEV.P for a population. Standard deviation is the square root of variance and is in the same units as your data.