Part 1: Introduction
The COVARIANCE.P
function in Excel determines the covariance, a measure of how much two random variables vary together. It’s often used in probability theory and statistics, particularly finance and investment.
The syntax for the COVARIANCE.P
function is as follows:
=COVARIANCE.P(array1, array2)
The arguments are:
array1
: The first cell range of integers.array2
: The second cell range of integers.
This function will return a numerical value representing the two arrays’ covariance. A positive value indicates that the arrays increase and decrease together (positive correlation). In contrast, a negative value indicates that one collection tends to increase when the other decreases (negative correlation).
Note: The COVARIANCE.P
function calculates the “population” covariance. For a “sample” covariance, use COVARIANCE.S
.
Part 2: Examples
Example 1:
Purpose: To determine the covariance of the quarterly sales of two products, A and B.
Data tables and formulas:
A | B | C | |
---|---|---|---|
1 | Product A | Product B | |
2 | Q1 | 100 | 120 |
3 | Q2 | 200 | 220 |
4 | Q3 | 150 | 180 |
5 | COVARIANCE.P | =COVARIANCE.P(B2:B4, C2:C4) | 833.333 |
Explanation: The positive covariance value suggests that the sales of Product A and Product B tend to increase and decrease together across quarters.
Example 2:
Purpose: To determine the covariance of the monthly production units of two factories.
Data tables and formulas:
A | B | C | |
---|---|---|---|
1 | Factory 1 | Factory 2 | |
2 | January | 500 | 400 |
3 | February | 600 | 500 |
4 | March | 700 | 600 |
5 | COVARIANCE.P | =COVARIANCE.P(B2:B4, C2:C4) | 10,000 |
Explanation: The positive covariance value suggests that the monthly production units of Factory 1 and Factory 2 tend to increase and decrease together.
Example 3:
Purpose: To determine the covariance of the daily sales of two different restaurant branches.
Data tables and formulas:
A | B | C | |
---|---|---|---|
1 | Branch 1 | Branch 2 | |
2 | Day 1 | 200 | 150 |
3 | Day 2 | 220 | 160 |
4 | Day 3 | 210 | 170 |
5 | COVARIANCE.P | =COVARIANCE.P(B2:B4, C2:C4) | 166.667 |
Explanation: The positive covariance value suggests that the daily sales of Branches 1 and 2 tend to increase and decrease together.
Example 4:
Purpose: To determine the covariance of the monthly customers of two services, Service X and Service Y.
Data tables and formulas:
A | B | C | |
---|---|---|---|
1 | Service X | Service Y | |
2 | January | 1000 | 900 |
3 | February | 1100 | 950 |
4 | March | 1050 | 925 |
5 | COVARIANCE.P | =COVARIANCE.P(B2:B4, C2:C4) | 6250 |
Explanation: The positive covariance value suggests that Service X and Service Y’s monthly customers tend to increase and decrease together.
Example 5:
Purpose: To determine the covariance of the monthly sales of two products, Product C and Product D.
Data tables and formulas:
A | B | C | |
---|---|---|---|
1 | Product C | Product D | |
2 | January | 300 | 350 |
3 | February | 350 | 340 |
4 | March | 320 | 330 |
5 | COVARIANCE.P | =COVARIANCE.P(B2:B4, C2:C4) | -83.333 |
Explanation: The negative covariance value suggests that the monthly sales of Product C and Product D tend to move in opposite directions.
Part 3: Tips and Tricks
- Covariance is a measure of correlation. But unlike the correlation coefficient, covariance is measured in units that are the product of the branches of the two variables. Therefore, it cannot be easy to interpret.
- A positive covariance means the variables are positively related, while a negative covariance means the variables are inversely related.
- Covariance is sensitive to changes in the center or scale of the variables. For a standardized measure of correlation, use the
CORREL
function to find the correlation coefficient. - Be cautious when interpreting the results. Covariance alone doesn’t explain the dependency relationship between the two variables. It only suggests the direction of the relationship.
- Always double-check your ranges –
array1
andarray2
must have the same number of data points. - Covariance can be helpful in financial analysis, for example, to understand how different securities in a portfolio move about one another.