COVAR Function

Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel for the web, Excel 2024, Excel 2024 for Mac, Excel 2021, Excel 2021 for Mac, Excel 2019, Excel 2016

Summary

The COVAR function calculates the covariance between two data sets, measuring how two variables change together. Positive covariance indicates that the variables tend to move in the same direction, while negative covariance suggests opposite movement.

Syntax

COVAR(array1, array2)

Parameters

Parameter Type Required Description
array1 Array Yes Required first array or range containing numbers
array2 Array Yes Required second array or range containing numbers

Using the COVAR Function

COVAR helps identify whether two variables tend to increase or decrease together. Use it in financial analysis to study relationships between returns, in quality control to examine process variables, or in research to understand variable dependencies.

Common COVAR Examples

Basic Covariance Calculation

=COVAR(A2:A6,B2:B6)

Calculates covariance between two datasets showing positive relationship (Result: 5.2)

Marketing Analysis

=COVAR(Ads_Spent, Sales_Revenue)

Measures if advertising spend correlates with revenue growth

Stock Analysis

=COVAR(StockA_Returns, StockB_Returns)

Analyzes if two stocks move together over time

Frequently Asked Questions

Positive covariance indicates that as one variable increases, the other tends to increase.

COVAR provides backward compatibility for legacy workbooks.

COVAR returns #N/A error if array1 and array2 have different numbers of data points.

Common Errors and Solutions

#N/A Error

Cause: Arrays have different numbers of data points

Solution: Ensure both arrays contain the same number of values

#DIV/0! Error

Cause: One or both arrays are empty

Solution: Provide data in both array arguments

#VALUE! Error

Cause: Arguments contain non-numeric data

Solution: Use only numeric values or ranges containing numbers

Notes

  • **Deprecated Function**: Microsoft recommends COVARIANCE.P or COVARIANCE.S for new workbooks
  • Ignores text, logical values, and empty cells (but includes zeros)
  • COVAR uses population covariance formula (divides by n)
  • Array1 and Array2 must have identical count of numeric values

Compatibility

Available in: Excel for Microsoft 365, Excel 2021, Excel 2019, Excel 2016, Excel 2013, Excel 2010, Excel 2007

Not available in: Future Excel versions (deprecated), Excel 2003 and earlier

Content last reviewed: December 8, 2025
Update frequency: As needed
Excel versions tested: Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel for the web, Excel 2024, Excel 2024 for Mac, Excel 2021, Excel 2021 for Mac, Excel 2019, Excel 2016