Compatibility function

COVAR function

Returns the population covariance of two data sets: the average product of their deviations from the mean. Replaced by COVARIANCE.P.

Available in All versions of Excel, including Microsoft 365 and Excel for the web (kept for compatibility)

In every Excel versionWorks in Google Sheets

Older function. COVAR still works, but for new workbooks use COVARIANCE.P.

Syntax

COVAR(array1, array2)
ArgumentWhat it means
array1RequiredThe first range of numbers.
array2RequiredThe second range, with the same number of values.

Returns: The population covariance (can be negative).

How COVAR works

Covariance measures whether two quantities move together. If months with higher ad spend also have higher sales, the covariance is positive; if one rises as the other falls, it is negative; if there is no pattern, it is near zero. COVAR multiplies each pair's deviations from their averages and takes the mean of those products.

Its size depends on the units (euros × units sold), so it is hard to interpret on its own. For a unit-free measure between -1 and 1 use CORREL. COVAR divides by n, treating the data as the whole population; text and empty cells in the ranges are ignored, and the two ranges must contain the same number of values.

Compatibility note: COVAR is one of the older statistical functions that Excel 2010 moved to the Compatibility group. It still works in every version, but for new workbooks Microsoft recommends COVARIANCE.P. It is a straight rename. If your data is a sample, use COVARIANCE.S instead, which divides by n − 1.

Examples

1Ad spend versus sales

E2fx=COVAR(B2:B6, C2:C6)
ABCDE
1MonthAd spend (€k)Sales (€k)
2Jan2209.8
3Feb326
4Mar431
5Apr533
6May641

Result: 9.8

Both columns rise together, so the covariance is positive: 9.8. =CORREL(B2:B6,C2:C6) would express the same relationship as a number close to 1.

2A negative relationship

E2fx=COVAR(B2:B5, C2:C5)
ABCDE
1WeekTemperature (°C)Hot-chocolate sales
2112140-291.875
321895
432560
543130

Result: -291.875

As the temperature rises, hot-chocolate sales fall, so the covariance is negative (-291.875).

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 14 KB

Common errors and how to fix them

ErrorWhy it happensFix
#N/AThe two ranges contain a different number of data points.Make the ranges the same size.
#DIV/0!A range is empty or contains no numbers.Check the ranges.

Tips

  • COVAR = COVARIANCE.P (divides by n). Statistics packages usually report the sample version, COVARIANCE.S (divides by n − 1), so results can differ slightly.
  • Covariance is in combined units; use CORREL when you want to compare the strength of different relationships.

Questions

Should I still use COVAR?

Only if the workbook must open in Excel 2007 or earlier. Otherwise use COVARIANCE.P, which gives the same result and makes the intent clearer to the next person who reads the formula.

Will COVAR stop working?

There is no announced removal date. Microsoft keeps compatibility functions so old workbooks keep calculating, but they get no new features.

Google Sheets

COVAR also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.

COVAR in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
DanishKOVARIANS
DutchCOVARIANTIE
FinnishKOVARIANSSI
FrenchCOVARIANCE
GermanKOVAR
HungarianKOVAR
ItalianCOVARIANZA
Norwegian (Bokmål)KOVARIANS
PolishKOWARIANCJA
RussianКОВАР
SwedishKOVAR
TurkishKOVARYANS