Syntax
| Parameter | Description |
|---|---|
| array1 | Parameter of the COVAR function. |
| array2 | Parameter of the COVAR function. |
Examples
Stock covariance
=COVAR(B2:B253, C2:C253)
Height vs. weight
=COVAR(D2:D100, E2:E100)
Covariance matrix entry
=COVAR(A2:A50, B2:B50)
Common Errors
The arrays have different lengths. Both must contain the same number of data points.
One or both arrays are empty.
Tips
COVAR calculates population covariance (divides by n). If your data is a sample, use COVARIANCE.S (divides by n-1).
Unlike CORREL, covariance depends on the scale of your data. Doubling all values in one array doubles the covariance. Use CORREL for a standardized measure.
Portfolio variance = w1^2*VAR(A) + w2^2*VAR(B) + 2*w1*w2*COVAR(A,B). Covariance is essential for diversification calculations.
Try COVAR in Viztab
Import your data and use COVAR with 370+ other formulas. No signup required.
Open Viztab