Over 2 million + professionals use CFI to learn accounting, financial analysis, modeling and more. Unlock the essentials of corporate finance with our free resources and get an exclusive sneak peek at the first module of each course.
Start Free
What is the COVAR Function?
The COVAR Function[1] is categorized under Excel Statistical functions. It will calculate the covariance of two sets of values.
As a financial analyst, suppose we want to see how two stocks may move together in the future. Looking at their historical prices, we can determine if the prices tend to move with each other or opposite each other. It allows us to predict the potential price movement of a two-stock portfolio.
A high, positive covariance value between two stocks implies that when the price of one goes up, that of the other usually does, too.
A high negative figure or value means that when one stock advances, the other generally retreats. If the figure is close to zero, with either a positive or negative sign, the two stocks act mostly independently.
Covariance Formula
=COVAR(array1, array2)
The COVAR function uses the following arguments:
Array1 (required argument) – This is a range or array of integer values.
Array2 (required argument) – Another range or array of integer values.
Notes
If the given arrays contain text or logical values, they are ignored by the COVAR function.
The data should contain numbers, names, arrays, or references that are numeric. If some cells do not contain numeric data, they are ignored.
The data sets should be of the same size, with the same number of data points.
The data sets should neither be empty, nor should the standard deviation of their values equal zero.
How to use the COVAR Function in Excel?
As a worksheet function, the COVAR function can be entered as part of a formula in a cell of a worksheet. To understand the uses of the function, let’s consider an example:
Example
Suppose we are given the following data:
We wish to find out covariance. The covariance of the values in columns B and C of the spreadsheet can be calculated using the COVAR function using the formula =COVAR(B2:B13, C2:C13).
We get the results below:
It gives the result -0.000563, which indicates a negative correlation between the two sets of stocks.
A few pointers about the COVAR Function:
The function was introduced in MS Excel 2000.
#VALUE! error – Occurs when one or both of the supplied data arrays are empty.
#N/A! error – Occurs if the given arrays are of different lengths.
In MS Excel 2010, the COVAR function was replaced by the COVARIANCE.P function. However, COVAR is still available in MS Excel 2010 (stored in the list of compatibility functions) to allow compatibility with earlier versions of Excel.
Thanks for reading CFI’s guide to the Excel COVAR function. By taking the time to learn and master these functions, you’ll significantly speed up your financial analysis. To learn more, check out these additional CFI resources:
To master the art of Excel, check out CFI’s Excel Crash Course, which teaches you how to become an Excel power user. Learn the most important formulas, functions, and shortcuts to become confident in your financial analysis.
Take your learning and productivity to the next level with our Premium Templates.
Upgrading to a paid membership gives you access to our extensive collection of plug-and-play Templates designed to power your performance—as well as CFI's full course catalog and accredited Certification Programs.
Gain unlimited access to more than 250 productivity Templates, CFI's full course catalog and accredited Certification Programs, hundreds of resources, expert reviews and support, the chance to work with real-world finance and research tools, and more.