CalcUnit Logo

How to Calculate Variance

Calculate population and sample variance of a dataset.

The Formula

Var = Σ(x-mean)²/n

The variance formula uses the mathematical relationship: Var = Σ(x-mean)²/n. Each variable in the formula represents a measurable quantity that affects the final result.

What Each Variable Means

Every value in the variance formula, what it measures, and the value used in the worked example on this page:

VariableTypeExample value
Value 1Input (you provide)2
Value 2Input (you provide)4
Value 3Input (you provide)4
Value 4Input (you provide)4
Value 5Input (you provide)5
MeanResult (calculated)—
Population Variance (σ²)Result (calculated)—
Sample Variance (s²)Result (calculated)—

Step-by-Step Method

  1. 1Write down the values you know: Value 1, Value 2, Value 3, Value 4, Value 5.
  2. 2Substitute your known values into the formula: Var = Σ(x-mean)²/n.
  3. 3Work through the arithmetic in the standard order of operations — parentheses first, then exponents, then multiplication and division, then addition and subtraction.
  4. 4Check that your result carries the correct unit and falls in a reasonable range for the problem.
  5. 5Verify your answer with the interactive Variance Calculator — it solves the same formula instantly.

Worked Example

Take a concrete case: value 1 = 1, with the other inputs at the typical values from the variables table above. Substituting into the formula gives mean = 3.6000, population variance (σ²) = 1.840000, sample variance (s²) = 2.300000. These numbers are solved by the same engine that powers the Variance calculator, so you can reproduce them exactly by entering the same inputs there.

Value 1MeanPopulation Variance (σ²)Sample Variance (s²)
0.53.50002.4000003.000000
13.60001.8400002.300000
23.80000.9600001.200000
34.00000.4000000.500000
44.20000.1600000.200000
54.40000.2400000.300000
64.60000.6400000.800000
85.00002.4000003.000000

How each result changes as value 1 changes, holding the other inputs constant.

Practice Problems

1. [2, 4, 4, 4, 5]: With Value 1 2, Value 2 4, Value 3 4, Value 4 4, Value 5 5, what are the results?

Answer: Entering Value 1 2, Value 2 4, Value 3 4, Value 4 4, Value 5 5 gives Mean 3.8000, Population Variance (σ²) 0.960000, Sample Variance (s²) 1.200000.

2. Value 1 12.5, Value 2 20, Value 3 30, Value 4 40, Value 5 50 — work it out, then check the answer.

Answer: The calculator returns Mean 30.5000, Population Variance (σ²) 181.000000, Sample Variance (s²) 226.250000 for Value 1 12.5, Value 2 20, Value 3 30, Value 4 40, Value 5 50.

Frequently Asked Questions

What is the formula for variance?

The formula is: Var = Σ(x-mean)²/n. Calculate population and sample variance of a dataset.

What values do I need to calculate variance?

You need value 1, value 2, value 3, value 4, value 5. The calculator produces mean, population variance (σ²), sample variance (s²) from those inputs.

What is the variance when value 1 is 1?

With value 1 = 1, the result is mean = 3.6000, population variance (σ²) = 1.840000, sample variance (s²) = 2.300000. This is worked through in full in the example on this page.

Related Topics

variancestatistics

Use the Interactive Calculator

Skip the manual math — get instant results with our free Variance calculator.

Open Calculator

Related Calculators