The Excel COVARIANCE.P Function

Related Function:
COVARIANCE.S
Covariance

The covariance is a statistical measurement of the strength of the correlation between two sets of variables, and is calculated by the following equation:

COVARIANCE Equation

where x and y are the sample means (averages) of the two sets of values, and n is the sample size.

Further information can be found on the Wikipedia Covariance page

Basic Description

The Excel COVARIANCE.P function calculates the covariance of two supplied sets of values.

The function is new in Excel 2010 and so is not available in earlier versions of Excel. However, the Covariance.P function is simply a new version of the Covar function that is available in earlier versions of Excel.

The format of the function is :

COVARIANCE.P( array1, array2 )

Where array1 and array2 are two arrays of numeric values, that are of equal length.

Note that the Covariance.P function ignores text values and logical values that are supplied as part of an array.


Covariance.P Function Example

 AB
1array1array2
2222.90
3733.49
4834.50
5327.61
6419.5
7110.11
8637.90
9531.08

Columns A and B of the above spreadsheet on the right contain two sets of values.

The population covariance of the values in columns A and B of the spreadsheet can be calculated using the Excel Covariance.P function, as follows:

=COVARIANCE.P( A2:A9, B2:B9 )

This gives the result 16.633125, which indicates a positive correlation between the two sets of values.


Further examples of the Excel Covariance.P function can be found on the Microsoft Office website.


Covariance.P Function Common Problems

If you get an error from the Excel Covariance.P Function, this is likely to be one of the following:

Common Errors
#N/A-Occurs if the two supplied data arrays have different lengths
#VALUE!-Occurs if one or both of the supplied data arrays are empty