Category: FUNCTION | Updated: 2026-11-22

How to Use the VAR Function in Google Sheets | Calculate Sample Variance

Syntax

=VAR(value1, [value2, ...])
  • value1: The first value or range of the sample.
  • value2, … (optional): Additional values or ranges to include in the sample.

Example with a Table

Here is an example of calculating sample variance from a 5-day sample of store visitors (A2:A6).

Cell A (Visitors) B (Metric) C (Formula) D (Result)
1 Visitors Metric Formula Result
2 40 Mean Visitors =AVERAGE(A2:A6) 45.0
3 50 Sample Variance =VAR(A2:A6) 17.5
4 45 Sample Standard Deviation =STDEV(A2:A6) 4.18
5 42
6 48

It sums the squared differences between each value and the mean (45.0) and divides by “count - 1” (4) to return 17.5.

Common Errors and Notes

  • #DIV/0! Error: Occurs if there are fewer than 2 numeric values in the range.
  • Values can get large: Because variance uses the squared difference from the mean, the resulting numbers can be much larger than the original data and harder to interpret intuitively. Pair it with standard deviation (STDEV / STDEV.S), which takes the square root.
  • Choosing between sample and population: If your data represents the entire population rather than a sample, use VARP or VAR.P.

Frequently Asked Questions

Q. How are variance (VAR) and standard deviation (STDEV) related?

A. Variance is the square of the standard deviation, and standard deviation is the square root of the variance. Use STDEV when you want the units to match the original data.

Q. What is the difference between VAR and VAR.S?

A. Their calculation results and functionality are identical. VAR.S is a newer function name that explicitly indicates Sample, and VAR.S is now recommended.