VAR function
VAR returns the sample variance, the squared spread of sample data, using n-1, so it treats your data as a sample of a larger group. It is a compatibility function, so use VAR.S in new workbooks.
Example
Read it as a sentence: estimate the variance of the sample in A1:A8, which gives 4.571428571.
Excel shows 4.571428571
A
1
2
2
4
3
4
4
4
5
5
6
5
7
7
8
9
Data
Syntax
VAR(number1, [number2], ...)
Arguments in [square brackets] are optional.
-
number1(required) - A number, range or array (sample).
-
number2(optional) - More values.
Returns: The sample variance.
What Excel actually returns
Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.
| Formula | Excel shows | Case |
|---|---|---|
=VAR({2,4,4,4,5,5,7,9}) | 4.571428571 | Array constant |
=VAR(10,"20",TRUE) | 90.33333333 | Direct args: number, text-number, TRUE |
=VAR({1,"2",TRUE,3}) | 2 | Array with text and boolean |
=VAR(Data!A1:A8) | 4.571428571 | Range of numbers |
=VAR(Data!B1:B8) | 233.3333333 | Mixed range: num, text-number, TRUE, blank, text, FALSE |
=VAR(Data!A1:A4,Data!F1:F5) | 1.694444444 | Two ranges |
=VAR(10,"abc") | #VALUE! | Direct arg: non-numeric text |
=VAR(5) | #DIV/0! | Single number |
The Data sheet these formulas read
A cell that starts with = holds that formula.
A
B
F
1
2
10
1
2
4
20
2
3
4
TRUE
3
4
4
4
5
5
abc
5
6
5
30
7
7
FALSE
8
9
40
Data
Watch out for
- Superseded by VAR.S; use that in new workbooks.
- Uses n-1.
Where it works
- Excel
- VAR is in every version of Excel from 2007 on. Compatibility function: still works in every version, but newer replacements exist.
- Google Sheets
- Same name, same behaviour for everyday use.
Part of Compatibility functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .