The VAR function in Google Sheets is a statistical tool used to calculate the variance of a set of values that represent a sample. Variance is a key measure in statistics that indicates the degree to which data points differ from their mean, providing insight into data dispersion. This function is essential for statistical analysis and is commonly used in various fields, including finance, research, and data science.
Syntax
VAR(value1, [value2, ...])
- value1: The first value or range for which the variance is calculated.
- value2: Optional. Additional values or ranges for which the variance can be computed (up to 30 values).
Example #1
VAR(A1:A5)
This function calculates the variance of the values in cells A1 through A5. For example, if A1=10, A2=12, A3=15, A4=18, and A5=20, the result would be approximately 10.00, indicating the spread of these sample values.
Example #2
VAR(5, 10, 15, 20)
This function computes the variance of the given individual numbers. In this case, the result would be 62.50, showing the variability of this specific set of numbers.
Example #3
VAR(B1:C4)
This function calculates the variance of all values from the range B1 to C4. If these cells contain a variety of numerical data, the result provides an overview of the data’s overall variability.
Error handling
- DIV/0!: This error occurs when there are no valid numerical data points provided, leading to an undefined variance calculation.
- VALUE!: This indicates that one or more of the arguments provided are text values, which cannot be processed by the VAR function.
- N/A: This error arises if any referenced cells are empty or contain an error, making it impossible to calculate variance accurately.