The COVARIANCE.S function in Excel is a statistical tool used to measure the degree to which two sets of data vary together. It calculates the sample covariance, helping analysts understand the relationship between variables, which is essential for data analysis and interpretation in various fields.
Syntax
COVARIANCE.S(array1, array2)
- array1: The first dataset or range of values.
- array2: The second dataset or range of values to compare against the first.
Example #1
=COVARIANCE.S(A1:A10, B1:B10)
This function computes the covariance between the values in range A1:A10 and B1:B10, which might yield a result of, for instance, 4.56, indicating a positive relationship between the two datasets.
Example #2
=COVARIANCE.S(D1:D5, E1:E5)
This formula evaluates the covariance between the datasets in D1:D5 and E1:E5; one potential output could be -1.23, suggesting a negative relationship between these variables.
Example #3
=COVARIANCE.S(X1:X20, Y1:Y20)
Here, the function assesses the covariance for values in X1:X20 against Y1:Y20, which might return a value of 0.00, indicating no relationship between the two datasets.
Error handling
- DIV/0!: This error occurs if one or both of the specified arrays are empty, meaning there is no data to calculate covariance.
- N/A: This error indicates that the arrays contain different numbers of data points, which prevents a valid covariance calculation.
- VALUE!: This error arises when the supplied arrays contain non-numeric data, making it impossible to proceed with the calculation.