Example 1
Variance of a steady line
B8 =VAR.S(B2:B6)
Result: 0.5
The average is 50. Squared deviations of 0, 1, 1, 0 and 0 add up to 2, and 2 / (5 - 1) = 0.5.
B8 =VAR.S(B2:B6) returns 0.5
Returns the variance of a sample: the average squared distance of values from their mean, using n - 1 in the divisor.
Syntax
=VAR.S(, [number2], ...)
Excel 2010 and later, including Excel for Microsoft 365 and Excel for the web. The older VAR function works in every version.
Try it
Edit the formula in B8 or change the inputs. The sheet recalculates as you type.
B8 =VAR.S(B2:B6) returns 0.5
VAR.S measures how spread out a sample is. It averages the squared distance of each value from the mean, dividing by n − 1. Because the distances are squared, the result is in squared units, such as "days squared", which is hard to read directly. That is why most reports quote the standard deviation, STDEV.S, which is the square root of the variance. Variance is the figure you use when combining or comparing spread mathematically.
Variances add up in ways standard deviations do not. When you add two independent measurements, their variances add, so the variance of total lead time is the sum of the variances of each stage. Statistical tests such as ANOVA and the F-test work with variances, and so does portfolio risk, where variance and covariance feed into the total.
If two production lines make the same product, the one with the larger variance is less consistent. A ratio of variances tells you how much more variable one is than the other. A line with variance 250 against another with variance 0.5 is far more erratic; the ratio of 500 says by how much, in squared units.
VAR.S treats the numbers as a sample, so it divides by n − 1. Use it when your data is part of a bigger group and you want to estimate that group's variance. When your data is the whole group, use VAR.P instead, which divides by n. The gap matters most with small data sets: for five values the sample variance is 25% larger than the population variance.
In a range or cell reference, VAR.S ignores text, blanks and TRUE/FALSE. Numbers typed directly as arguments are counted. If the data contains an error value, the result is that error. With fewer than two numbers, VAR.S returns #DIV/0!.
The older VAR gives identical results. It stays in Excel for compatibility, but VAR.S is the name to use in new work. The matching functions for text-aware ranges are VARA and VARPA, which count text as zero and are rarely what you want.
The variance is always zero or positive. It is zero only when every value is identical. For summary measures of the centre, see AVERAGE and MEDIAN.
B2:B6.Each example is a live sheet. Change the inputs or the formula and watch the result.
Example 1
B8 =VAR.S(B2:B6)
Result: 0.5
The average is 50. Squared deviations of 0, 1, 1, 0 and 0 add up to 2, and 2 / (5 - 1) = 0.5.
B8 =VAR.S(B2:B6) returns 0.5
Example 2
C8 =VAR.S(C2:C6)
Result: 250
Both lines average 50, but Line B swings by 10 to 20 units either way. The squared deviations add up to 1,000, and 1,000 / 4 = 250.
C8 =VAR.S(C2:C6) returns 250
Example 3
B8 =VAR.S(C2:C6)/VAR.S(B2:B6)
Result: 500
Line B is 500 times as variable as Line A in squared units. The ratio of the standard deviations would be about 22.4.
B8 =VAR.S(C2:C6)/VAR.S(B2:B6) returns 500
Example 4
B4 =VAR.S(B2)
Result: #DIV/0!
A sample needs at least two numbers, because the divisor is n - 1.
B4 =VAR.S(B2) returns #DIV/0!
Solve it in the sheet. Every answer is checked, with hints if you need them.
Task 1 of 2
Five days are a sample of production. In B8, return the variance of Line A's output.
Answer in B8.
#DIV/0!.They return the same result. VAR.S is the newer name from Excel 2010, and VAR is kept for compatibility.
VAR.S divides by n - 1 and treats the data as a sample. VAR.P divides by n and treats it as the whole population. VAR.S is always the larger of the two.
Standard deviation is the square root of variance. `=SQRT(VAR.S(B2:B6))` equals `=STDEV.S(B2:B6)`.
The range holds fewer than two numbers. Check that the values are numbers and not text.
Tracks take you from the basics to modelling, one graded exercise at a time.