Financial Modeling Tutorials

- Excel Modeling
- Financial Functions in Excel
- Sensitivity Analysis in Excel
- Sensitivity Analysis
- Capital Budgeting Techniques
- Time Value of Money
- Future Value Formula
- Present Value Factor
- Perpetuity Formula
- Present Value vs Future Value
- Annuity vs Pension
- Present Value of an Annuity
- Doubling Time Formula
- Annuity Formula
- Present Value of an Annuity Formula
- Future Value of Annuity Due Formula
- Maturity Value
- Annuity vs Perpetuity
- Annuity vs Lump Sum
- Deferred Annuity Formula
- Internal Rate of Return (IRR)
- IRR Examples (Internal Rate of Return)
- NPV vs XNPV
- NPV vs IRR
- NPV Formula
- NPV Profile
- NPV Examples
- Advantages and Disadvantages of NPV
- Mutually Exclusive Projects
- PV vs NPV
- IRR vs ROI
- Break Even Point
- Break Even Analysis
- Breakeven Analysis Examples
- Break Even Chart
- Benefit Cost Ratio
- Payback Period & Discounted Payback Period
- Payback period Formula
- Discounted Payback Period Formula
- Payback Period Advantages and Disadvantages
- Profitability Index
- Feasibility Study Examples
- Cash Burn Rate
- Interest Formula
- Simple Interest
- Simple Interest vs Compound Interest
- Simple Interest Formula
- CAGR Formula (Compounded Annual Growth Rate)
- Growth Rate Formula
- Effective Interest Rate
- Loan Amortization Schedule
- Mortgage Formula
- Loan Principal Amount
- Interest Rate Formula
- Rate of Return Formula
- Effective Annual Rate
- Effective Annual Rate Formula (EAR)
- Compounding
- Compounding Formula
- Compound Interest
- Compound Interest Examples
- Daily Compound Interest
- Monthly Compound Interest Formula
- Discount Rate vs Interest Rate
- Discounting Formula
- Rule of 72
- Geometric Mean Return
- Geometric Mean vs Arithmetic Mean
- Real Rate of Return Formula
- Continuous compounding Formula
- Weighted average Formula
- Average Formula
- EWMA (Exponentially Weighted Moving Average)
- Average Rate of Return Formula
- Mean Formula
- Mean Examples
- Population Mean Formula
- Weighted Mean Formula
- Harmonic Mean Formula
- Median Formula in Statistics
- Range Formula
- Outlier Formula
- Decile Formula
- Midrange Formula
- Quartile Deviation
- Expected Value Formula
- Exponential Growth Formula
- Margin of Error Formula
- Decrease Percentage Formula
- Relative Change
- Percent Error Formula
- Holding Period Return Formula
- Cost Benefit Analysis
- Cost Benefit Analysis Examples
- Cost Volume Profit Analysis
- Opportunity Cost Formula
- Opportunity Cost Examples
- APR vs APY
- Mortgage APR vs Interest Rate
- Normal Distribution Formula
- Standard Normal Distribution Formula
- Normalization Formula
- Bell Curve
- T Distribution Formula
- Regression Formula
- Regression Analysis Formula
- Multiple Regression Formula
- Correlation Coefficient Formula
- Correlation Formula
- Correlation Examples
- Coefficient of Determination
- Population Variance Formula
- Covariance Formula
- Coefficient of Variation Formula
- Sample Standard Deviation Formula
- Relative Standard Deviation Formula
- Standard Deviation Formula
- Standard Deviation Examples
- Effect Size
- Sample Size Formula
- Volatility Formula
- Binomial Distribution Formula
- Multicollinearity
- Hypergeometric Distribution
- Exponential Distribution
- Central Limit Theorem
- Poisson Distribution
- Central Tendency
- Hypothesis Testing
- Gini Coefficient
- Quartile Formula
- P Value Formula
- Skewness Formula
- R Squared Formula
- Adjusted R Squared
- Regression vs ANOVA
- Z Test Formula
- Z Score Formula
- Z Test vs T Test
- F-Test Formula
- Quantitative Research
- Histogram Examples

Related Courses

Covariance is a statistical measure used to find the relationship between two assets and its formula calculates this by looking at the standard deviation of the return of the two assets multiplied by the correlation, if this calculation gives a positive number then the assets are said to have positive covariance i.e. when the returns of one asset goes up, the return of second assets also goes up and vice versa for negative covariance.

**Covariance Formula – Table of Contents**

## What is Covariance Formula?

In the financial parlance, the term “covariance” is primarily used in portfolio theory and it refers to the measurement of the relationship between the returns of two stocks or other assets. The formula for covariance between stock A and stock B can be calculated on the basis of returns of both the stocks at different intervals and the sample size or the number of intervals.

Mathematically, it is represented as,

where

- R
_{Ai }=Return of stock A in the i^{th}interval - R
_{Bi }=Return of stock B in the i^{th}interval - R
_{A}=Mean of the return of stock A - R
_{B}=Mean of the return of stock B - n = Sample size or the number of intervals

The formula for the calculation of covariance between stock A and stock B can also be derived by multiplying the standard deviation of returns of stock A, the standard deviation of returns of stock B and the correlation between returns of stock A and stock B. Mathematically, it is represented as,

**Cov (R _{A}, R_{B}) = **

**ρ**

**(A, B) ***

**ơ**

_{A}*****

**ơ**

_{B}where ρ(A, B) = Correlation between returns of stock A and stock B

_{A}= Standard deviation of returns of stock A- ơ
_{B}= Standard deviation of returns of stock B

### Explanation of the Covariance Formula

The formula for the calculation of covariance between stock A and stock B can be derived by using the first method in the following steps:

**Step 1:** Firstly, determine the returns of stock A at different intervals and they are denoted by R_{Ai }which is the return in the i^{th} interval i.e. R_{A1 }, R_{A2 },R_{A3 },…..,R_{An }are the returns for 1^{st}, 2^{nd}, 3^{rd},….. and n^{th} interval.

**Step 2:** Next, determine the returns of stock B at the same intervals and they are denoted by R_{Bi }

**Step 3:** Next, calculate the mean of the returns of stock A by adding all the returns of stock A and then dividing the result by the number of intervals. It is denoted by R_{A}

4.9 (1,067 ratings)

**Step 4:** Next, calculate the mean of the returns of stock B by adding all the returns of stock B and then dividing the result by the number of intervals. It is denoted by R_{B}

** **

**Step 5:** Finally, the formula for the calculation of covariance is derived on the basis of returns of both the stocks, their mean returns and the number of intervals as shown above.

The formula for the calculation of covariance between stock A and stock B can also be derived by using the second method in the following steps:

**Step 1:** Firstly, determine the standard deviation of the returns of stock A on the basis of the mean return, returns at each interval and number of intervals. It is denoted by ơ_{A}.

**Step 2:** Next, determine the standard deviation of the returns of stock B and it is denoted by ơ_{B}.

**Step 3:** Next, determine the correlation between the returns of stock A and that of stock B by using statistical methods such as Pearson R test. It is denoted by ρ(A, B).

**Step 4:** Finally, the formula for calculation of covariance between stock A and stock B can be derived by multiplying the standard deviation of returns of stock A, the standard deviation of returns of stock B and the correlation between returns of stock A and stock B as shown below.

**Cov (R _{A}, R_{B}) = **

**ρ**

**(A, B) ***

**ơ**

_{A}*****

**ơ**

### Example of Covariance Formula (with Excel Template)

Let’s see some simple to advanced examples of Covariance formula to understand it better.

**Let us take the example of stock A and stock B with the following daily returns for three days.**

Below is given data for calculation of covariance.

Using the above information we will do the calculation of covariance as follows,

Determine the covariance between stock A and stock B.

Given, R_{A1 }= 1.2%,R_{A2 }= 0.5%,R_{A3 }= 1.0%

R_{B1}= 1.7%,R_{B2 }= 0.6%,R_{B3 }= 1.3%

Therefore, calculation of the covariance in excel will be as follows,

Now, Mean Return of stock A,R_{A}= (R_{A1 }+ R_{A2 }+ R_{A3 } ) / n

- R
_{A}= (1.2% + 0.5% + 1.0%) / 3 - R
_{A}=**0.9%**

Mean Return of Stock B, R_{B}= (R_{B1 }+R_{B2}+ R_{B3 }) / n

- R
_{B}= (1.7% + 0.6% + 1.3%) / 3 - R
_{B}=**1.2%**

Therefore, the covariance between stock A and stock B can be calculated as,

- Covariance Formula = [(1.2 – 0.9) * (1.7 – 1.2) + (0.5 – 0.9) * (0.6 – 1.2) + (1.0 – 0.9) * (1.3 – 1.2)] / (3 -1)

**Covariance formula between Stock A and Stock B will be –**

- Cov (R
_{A}, R_{B}) =**0.200**

Therefore, the correlation between stock A and stock B is 0.200 which is positive and as such it means that both returns move in the same direction i.e. either both have positive returns or both have negative returns.

### Relevance and Uses

From the perspective of a portfolio analyst, it is important to grasp the concept of covariance because it is primarily used in portfolio theory to decide which assets are to be included in the portfolio. It is a statistical tool to measure the directional relationship between the price movement of two assets such as stocks. It can also be used to ascertain the movement of a stock vis-à-vis the benchmark index i.e. whether the stock price goes up or goes down with the increase in the benchmark index or vice versa. This metric helps a portfolio analyst to reduce the overall risk for a portfolio. A positive covariance indicates that the assets move in the same direction, while a negative covariance indicates that the assets move in opposite directions.

### Recommended Articles

This has been a guide to Covariance Formula. Here we discuss how to calculate covariance using its formula along with an example and downloadable excel template. You can learn more about financing from the following articles –

- Examples of Sample Size Formula
- Population Variance Formula
- Formula of Sample Standard Deviation
- Formula of Relative Standard Deviation
- Formula of Variance Analysis
- Calculate Portfolio Variance
- Overview of Variance Analysis
- Correlation Matrix Excel
- Correlation vs Covariance – Compare

- 250+ Courses
- 40+ Projects
- 1000+ Hours
- Full Lifetime Access
- Certificate of Completion