What is variance?
Variance is roughly the average of the squared distances from the mean. Because the distances are squared, its units are squared too (days², inches²), so it is hard to picture. Take its square root and you get the standard deviation, back in the units of your numbers.
Source NIST/SEMATECH e-Handbook of Statistical Methods · 1.3.5.6 Measures of scale ↗CDC · Principles of Epidemiology, Lesson 2, Section 7: Measures of spread ↗
Sample variance or population variance?
Use the sample variance unless you have every value there is. A sample, like 30 patients from one hospital, divides by one less than how many numbers there are (n − 1), which makes the answer a little bigger. The population variance divides by n, and fits only when the list is complete, like all 10 tools a factory made. This calculator always shows both.
| Your numbers are | Excel formula |
|---|---|
| A sample | =VAR.S(A2:A11) |
| The whole population | =VAR.P(A2:A11) |
Source Microsoft Support · VAR.S function (sample), with example ↗Microsoft Support · VAR.P function (whole population), with example ↗
How to calculate variance
The variance is the first four of CDC’s five steps for the standard deviation. Here they are with your numbers.
Here it is with your numbers:
- Find the mean: the 5 numbers add up to 125, and 125 ÷ 5 = 25.
- Subtract the mean from each number and square the result: (27 − 25)² gives 4, (31 − 25)² gives 36, (15 − 25)² gives 100, (30 − 25)² gives 25, (22 − 25)² gives 9.
- Add the squares: 4 + 36 + 100 + 25 + 9 = 174.
- Divide by 4, one less than how many numbers there are: 174 ÷ 4 = 43.5. This is the variance.
It means the squared distances from the mean average out to about 43.5. Take the square root to get the standard deviation, 6.6, back in the original units.
Each number’s distance from the mean
| Number | Minus the mean | Squared |
|---|---|---|
| 27 | 2 | 4 |
| 31 | 6 | 36 |
| 15 | −10 | 100 |
| 30 | 5 | 25 |
| 22 | −3 | 9 |
| Total 125 | 0 | 174 |
Variance examples
| Numbers | Variance |
|---|---|
| 27, 31, 15, 30, 22 (days) | Sample 43.5 |
| 1345, 1301 … 1299 (10 tools) | Sample 754.27 |
| The same 10 tools, as the whole population | Population 678.84 |
| 2, 0, 3, 1, 0, 1, 2, 2, 4, 8, 1, 3, 3, 12, 1, 6, 2, 5, 1 (doses) | Sample 9 |
FAQs
How do you calculate variance?
Find the mean, subtract it from each number and square the results, add the squares, then divide by one less than how many numbers there are. For 27, 31, 15, 30 and 22 days, the mean is 25, the squares add up to 174, and 174 ÷ 4 is a variance of 43.5 days squared.
Source CDC · Principles of Epidemiology, Lesson 2, Section 7: Measures of spread ↗
What is variance in statistics?
Variance is roughly the average squared distance of the numbers from their mean. Squaring gives far-out numbers more weight: a number 10 away from the mean adds 100, while one 2 away adds only 4.
Source NIST/SEMATECH e-Handbook of Statistical Methods · 1.3.5.6 Measures of scale ↗
How do you calculate sample variance?
Add up the squared distances from the mean, then divide by n − 1, one less than how many numbers you have, instead of by n. That is the sample variance; dividing by n gives the population variance.
Source CDC · Principles of Epidemiology, Lesson 2, Section 7: Measures of spread ↗
How do you calculate variance in Excel?
Use =VAR.S(A2:A11) when your numbers are a sample, and =VAR.P(A2:A11) when they are the whole population. On Microsoft’s breaking-strength example, VAR.S gives 754.27 and VAR.P gives 678.84.
Source Microsoft Support · VAR.S function (sample), with example ↗
Sources
- CDC: Principles of Epidemiology, Lesson 2, Section 7: Measures of spread
- NIST/SEMATECH e-Handbook of Statistical Methods: 1.3.5.6 Measures of scale
- Microsoft Support: VAR.S function (sample), with example
- Microsoft Support: VAR.P function (whole population), with example