Spreadsheet Practice

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

ArgumentRequired?What it is
number1RequiredThe first number, cell or range in the sample.
number2OptionalMore 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.

CellFormulaResultWhat it shows
F2=VAR(B2:B7)0.14Fund A's monthly returns barely vary, in percent squared
F3=SQRT(VAR(B2:B7))0.37The square root is the standard deviation, back in percent
F4=VAR(C2:C7)8.09Fund 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
MonthFund A (%)Fund B (%)CheckResult
Jan1.23.1Variance, fund A0.14
Feb0.8-2.2Back to std dev0.37
Mar1.54.4Variance, fund B8.09
Apr0.4-1.8
May12.7
Jun0.9-0.9

Practice VAR

Graded instantly, then re-checked on changed data.

Demand variance by product

In G2, calculate the sample variance of the first product's weekly demand. Fill down to G4.

Common mistakes

What you seeWhy, and how to fix it
The number seems huge or tinyVariance 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.