Practice free

COVAR function

COVAR measures whether two series move together by averaging the products of their deviations from the mean. It is a compatibility function; use COVARIANCE.P in new workbooks.

Example

Read it as a sentence: find how the values in G1:G5 and F1:F5 vary together, treating them as the whole population.

Practice this in the app

Syntax

COVAR(array1, array2)

array1 (required)
First set of numbers.
array2 (required)
Second set, same length.

Returns: The population covariance of the two sets.

What Excel actually returns

Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.

FormulaExcel showsCase
=COVAR({2,4,5,4,5},{1,2,3,4,5}) 1.2 Array constants
=COVAR(Data!G1:G5,Data!F1:F5) 1.2 Two ranges (y,x order as written)
=COVAR(Data!I1:I5,Data!H1:H5) 2 Blank and text-number pairs dropped
=COVAR(Data!G1:G5,Data!J1:J5) 0 Constant x
=COVAR(Data!G1,Data!F1) 0 Single pair
=COVAR(Data!G1:G2,Data!F1:F2) 0.5 Two pairs
=COVAR(Data!G1:G5,Data!K1:K3) #N/A Different sizes
=COVAR(Data!C1:C5,Data!F1:F5) #N/A Range containing #N/A

The Data sheet these formulas read

A cell that starts with = holds that formula.

Watch out for

  • Superseded by COVARIANCE.P; use that in new workbooks.
  • Divides by n (population). For a sample, use COVARIANCE.S.
  • Arrays of different lengths give #N/A.

Where it works

Excel
COVAR is in every version of Excel from 2007 on. Compatibility function: still works in every version, but newer replacements exist.
Google Sheets
Same name, same behaviour for everyday use.

Part of Compatibility functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .