VAR function
Estimates the variance of a population from a sample (divides by n − 1). Replaced by VAR.S.
Available in All versions of Excel, including Microsoft 365 and Excel for the web (kept for compatibility)
In every Excel versionWorks in Google Sheets
Syntax
VAR(number1, [number2], ...)| Argument | What it means | |
|---|---|---|
number1 | Required | A number, range or array from the sample. |
number2, ... | Optional | Up to 255 numbers or ranges in total. |
Returns: The sample variance.
How VAR works
Variance is the average squared distance from the mean — the square of the standard deviation. It is in squared units (g², €²), which makes it less intuitive than STDEV, but it is the quantity statistics formulas work with: variances of independent things add up, F-tests compare variances, and ANOVA splits total variance into parts.
VAR treats the data as a sample and divides by n − 1. Text and logical values in ranges are ignored (VARA counts them), and you need at least two numbers.
Compatibility note: VAR is one of the older statistical functions that Excel 2010 moved to the Compatibility group. It still works in every version, but for new workbooks Microsoft recommends VAR.S. VAR.S gives identical results. Use VARP / VAR.P if your data is the whole population.
Examples
1Variance of fill weights
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Bag | Weight (g) | ||
| 2 | 1 | 498 | 11.77 | |
| 3 | 2 | 502 | ||
| 4 | 3 | 495 | ||
| 5 | 4 | 505 | ||
| 6 | 5 | 500 | ||
| 7 | 6 | 499 |
Result: 11.77
The sum of squared deviations from the mean (499.83) is 58.83; divided by n − 1 = 5 that gives 11.77 g² (formatted to 2 decimals). Its square root is the STDEV of 3.43 g.
2Variance of daily orders
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Day | Orders | ||
| 2 | Mon | 41 | 4.6667 | |
| 3 | Tue | 44 | ||
| 4 | Wed | 39 | ||
| 5 | Thu | 45 | ||
| 6 | Fri | 40 | ||
| 7 | Sat | 43 | ||
| 8 | Sun | 42 |
Result: 4.6667
The mean is 42 orders. Squared deviations add up to 28, and 28 / 6 = 4.6667 orders² (formatted to 4 decimals). Because variances of independent days add up, a 14-day total would have a variance of about 14 × 4.67 = 65.3.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#DIV/0! | Fewer than two numeric values. | Check the range contents. |
Tips
VAR(range)equalsSTDEV(range)^2.
Questions
Should I still use VAR?
Only if the workbook must open in Excel 2007 or earlier. Otherwise use VAR.S, which gives the same result and makes the intent clearer to the next person who reads the formula.
Will VAR stop working?
There is no announced removal date. Microsoft keeps compatibility functions so old workbooks keep calculating, but they get no new features.
Google Sheets
VAR also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.
VAR 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 |
|---|---|
| Czech | VAR.VÝBĚR |
| Danish | VARIANS |
| German | VARIANZ |
| Norwegian (Bokmål) | VARIANS |
| Polish | WARIANCJA |
| Russian | ДИСП |
| Swedish | VARIANS |