Statistical function

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], ...)
ArgumentWhat it means
number1RequiredA number, reference or range from the sample.
number2, ...OptionalUp 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

D2fx=VAR.S(B2:B6)
ABCD
1BoxWeight (g)
2150214.5
32498
43505
54500
65495

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

D2fx=VAR.S(B2:B7)
ABCD
1DayUnits
2Mon5211.6
3Tue48
4Wed55
5Thu50
6Fri45
7Sat50

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).

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 14 KB

Common errors and how to fix them

ErrorWhy it happensFix
#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.

LanguageFunction name
DanishVARIANS.S
HungarianVAR.M
ItalianVAR.C
Norwegian (Bokmål)VARIANS.S
PolishWARIANCJA.PRÓBKI
Portuguese (Brazil)VAR.A
RussianДИСП.В
SwedishVARIANS.S