VAR function
VAR returns the variance of a sample: the average squared distance of each value from the mean. It's the square of the standard deviation and is used in finance and statistics formulas, such as portfolio risk. VAR.S is the newer name for the same calculation.
- Available in
- Every current version
- Category
- Statistical functions
- Returns
- The sample variance, or #DIV/0! if there are fewer than two numbers.
- Google Sheets
- Also available in Google Sheets.
Syntax
=VAR(number1, [number2], ...)
| Argument | Required? | What it is |
|---|---|---|
number1 | Required | The first number, cell or range in the sample. |
number2 | Optional | More numbers, cells or ranges, up to 255 in total. |
Examples
Each result below is calculated from the sample sheet by our formula engine, the same one that grades the practice.
| Cell | Formula | Result | What it shows |
|---|---|---|---|
| F2 | =VAR(B2:B7) | 0.14 | Fund A's monthly returns barely vary, in percent squared |
| F3 | =SQRT(VAR(B2:B7)) | 0.37 | The square root is the standard deviation, back in percent |
| F4 | =VAR(C2:C7) | 8.09 | Fund B's variance is about 60 times larger |
Try it live
This is the sample sheet. Change any number or text, or edit a formula, and the results update.
Show the sample data as a table
| Month | Fund A (%) | Fund B (%) | Check | Result | |
| Jan | 1.2 | 3.1 | Variance, fund A | 0.14 | |
| Feb | 0.8 | -2.2 | Back to std dev | 0.37 | |
| Mar | 1.5 | 4.4 | Variance, fund B | 8.09 | |
| Apr | 0.4 | -1.8 | |||
| May | 1 | 2.7 | |||
| Jun | 0.9 | -0.9 |
Practice VAR
Graded instantly, then re-checked on changed data.
Demand variance by product
G2, calculate the sample variance of the first product's weekly demand. Fill down to G4.Common mistakes
| What you see | Why, and how to fix it |
|---|---|
| The number seems huge or tiny | Variance is in squared units (dollars squared, percent squared). Take the square root, or use STDEV, for a number in the original units. |
| #DIV/0! | You need at least two numbers to calculate a sample variance. |
Tips
- Use VAR.P (or VARP in older versions) when the values are the complete population.
Questions
What is the difference between VAR and STDEV?
STDEV is the square root of VAR. Variance is used inside other formulas; standard deviation is easier to read because it's in the original units.
Is VAR the same as VAR.S?
Yes. VAR.S is the name used from Excel 2010; both return the sample variance.
Last reviewed October 2026. Every example result on this page is calculated live by the Spreadsheet Practice formula engine.