#### How to calculate covariance in Excel?

In this Excel tutorial, you learn how to calculate covariance in Excel.

We can detect the existence of a correlation relationship by examining the covariance.

Covariance is the average of the products of the deviations of each data point pair.

Use covariance to define the relationship between two datasets.

• A positive value of covariance occurs when both examined characteristics are moving in the same direction.
• Negative covariance occurs when the increase in the value of one feature tends to decrease the value of the other.
• It is also possible that the covariance is zero. This means that the variables are not correlated with each other.

## Sample Covariance

To calculate sample covariance use the COVARIANCE.S Excel function.

### COVARIANCE.S syntax

=COVARIANCE.S(array1,array2)

In the given example sample covariance formula is =COVARIANCE.S(A2:A10,B2:B10)

## Population Covariance

To calculate population covariance use the COVARIANCE.P Excel function.

### COVARIANCE.P syntax

=COVARIANCE.S(array1,array2)

In the given example sample covariance formula is =COVARIANCE.P(A2:A10,B2:B10)

In most cases, you will use sample covariance. Use covariance of population function only when it is specifically said that it is population covariance.

## Using the Data analysis tool

Using functions to enumerate the covariance is effective. I prefer to use the data analysis tool for covariance calculation. It is also a convenient way to calculate the covariance of a data table. Excel will prepare a covariance report based on the values ​​you provide.

To calculate the covariance with the data analysis tool, first go to the Excel ribbon. Click the Data tab. On the right side you will find the Data Analysis button.