COVAR()

Note

In Excel 2010, the COVAR() function was replaced with the COVARIANCE.P() and COVARIANCE.S() functions to increase the accuracy of the results. To ensure the backward compatibility of COVARIANCE.P() and COVARIANCE.S(), the COVAR() function is still available.

Syntax. COVAR(array1,array2)

Definition. This function returns the covariance of two value pairs. Use the covariance to determine the relationship between two data sets. For example, you can examine whether the increase in online orders is related to the number of website visits. To calculate the covariance, the deviations of all value pairs between the actual value and the mean is multiplied and the mean is formed.

Arguments

Note

The arguments must be numbers, names, arrays, or references that contain numbers. If an array or reference argument contains text, logical values, or empty cells, those values are ignored. However, cells with the value 0 are included.

If array1 and array2 have a different number of data points, COVAR() returns the #N/A error. If array1 or array2 is empty, the function returns the #DIV/0! error.

Background. The covariance describes the correlation between the two characteristics x and y with the terms positive and negative. This means that the direction of the dependency between the two characteristics is indicated. The covariance can have any real value.

What conclusions can you draw after the covariance is calculated?

Although the covariance indicates the direction of a correlation between two variables, there is no indication of the strength of the correlation. The reason for this is the dependency of the calculated covariance on the values of variables x and y. If the covariance of two variables is 5.2 meters, the covariance for the same values is 520 centimeters.

Note

The covariance as a measure for the stochastic correlation is not very descriptive and is difficult to compare. To make a correlation comparable, the covariance can be standardized. This way you get a correlation between two or more quantitative statistical variables with a value of +1 (perfect linear correlation), 0 (no linear correlation), and –1 (perfect reverse linear correlation).

You can derive the following important general correlations from the covariance and the two standard deviations:

The covariance is calculated as follows:

image with no caption

Values x and y are the sample means AVERAGE(array1) and AVERAGE(array2), and n is the sample size.

Example. Let’s use the example of the software company that sells its products through its website and sends out newsletters to boost the sales. Last year, the orders through the website significantly increased. To understand the reason for the increased sales, you calculate the correlation coefficient. Now you want to know the direction of the correlation between website visits and online orders and calculate the covariance. Figure 12-35 shows the result.

The COVAR() function calculates the direction of the dependency between two variables.

Figure 12-35. The COVAR() function calculates the direction of the dependency between two variables.

The positive result for the covariance indicates that the correlation between the x and y values (website visits and orders) is concordant linear. If x has high values, y also has high values. If x has low values, y has also low values. The positive covariance is confirmed by the correlation coefficient, 0.89, because this indicates a close linear correlation.

Figure 12-36 shows how you can get the same result by using the formula presented in the “Background” section of this function without the COVAR() function.

Calculating the covariance by using a mathematical formula.

Figure 12-36. Calculating the covariance by using a mathematical formula.

See Also

CORREL(), COVARIANCE.P(), COVARIANCE.S(), FISHER(), FISHERINV()