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.
Excel shows 1.2
F
G
1
1
2
2
2
4
3
3
5
4
4
4
5
5
5
Data
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.
| Formula | Excel shows | Case |
|---|---|---|
=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.
C
F
G
H
I
J
K
1
1
1
2
1
2
3
1
2
2
2
4
4
3
2
3
=NA()
3
5
3
5
3
3
4
4
4
4
4
4
3
5
5
5
5
5
5
3
Data
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 .