VAR.S function
Estimates the variance of a population from a sample: the squared spread of values around the mean, divided by n − 1.
Available in Excel 2010 and later, Microsoft 365, Excel for the web, Excel for Mac 2011 and later
Excel 2010 and laterWorks in Google Sheets
Syntax
VAR.S(number1, [number2], ...)| Argument | What it means | |
|---|---|---|
number1 | Required | A number, reference or range from the sample. |
number2, ... | Optional | Up to 254 more values. At least two numbers are needed. |
Returns: The sample variance s² (in squared units).
How VAR.S works
VAR.S is the sample version of variance. It squares each value's distance from the sample mean, adds the squares and divides by n − 1 rather than n. The n − 1 corrects for the fact that a sample's values huddle closer to their own average than to the true population average, which would otherwise make the variance look too small.
Use VAR.S whenever your numbers are a selection from something bigger: a test batch of products, a few weeks of sales, survey responses. Its square root is STDEV.S, usually easier to interpret because it is in the original units. Variance itself appears in many formulas: F-tests compare two variances, and the variance of a sum of independent items is the sum of their variances. VAR is the older name.
Examples
1Variance of a sample of fill weights
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Box | Weight (g) | ||
| 2 | 1 | 502 | 14.5 | |
| 3 | 2 | 498 | ||
| 4 | 3 | 505 | ||
| 5 | 4 | 500 | ||
| 6 | 5 | 495 |
Result: 14.5
The mean is 500 g. The sum of squared deviations is 58; dividing by 5 − 1 = 4 gives 14.5 g².
2Sample vs population variance
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Day | Units | ||
| 2 | Mon | 52 | 11.6 | |
| 3 | Tue | 48 | ||
| 4 | Wed | 55 | ||
| 5 | Thu | 50 | ||
| 6 | Fri | 45 | ||
| 7 | Sat | 50 |
Result: 11.6
11.6, larger than VAR.P's 9.6667 on the same data because it divides by 5 instead of 6. VAR.S ÷ VAR.P is always n/(n − 1).
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#DIV/0! | Fewer than two numbers. | A sample variance needs at least two values. |
#VALUE! | A typed argument is text that is not a number. | Use references. |
Tips
- Most real-world data is a sample, so VAR.S (and STDEV.S) is usually the right choice.
- DEVSQ returns the sum of squared deviations;
=DEVSQ(r)/(COUNT(r)-1)equals VAR.S.
Google Sheets
VAR.S also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.
VAR.S in other languages
In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.
| Language | Function name |
|---|---|
| Danish | VARIANS.S |
| Hungarian | VAR.M |
| Italian | VAR.C |
| Norwegian (Bokmål) | VARIANS.S |
| Polish | WARIANCJA.PRÓBKI |
| Portuguese (Brazil) | VAR.A |
| Russian | ДИСП.В |
| Swedish | VARIANS.S |