Statistical

COVARIANCE.P Formula

COVARIANCE.P returns the population covariance of two data sets, dividing by n. It is the modern replacement for COVAR and produces identical results. Use it when your data represents the entire population, or when the population covariance formula is specifically required (such as in portfolio theory calculations).

Syntax

COVARIANCE.P(array1, array2)
ParameterDescription
array1 Parameter of the COVARIANCE.P function.
array2 Parameter of the COVARIANCE.P function.
Try COVARIANCE.P in Viztab — free, no signup

Examples

Portfolio covariance

Formula
=COVARIANCE.P(C2:C253, D2:D253)
Returns the population covariance of two assets' returns. A negative value suggests the assets are good diversification candidates.

Sensor correlation

Formula
=COVARIANCE.P(A2:A1000, B2:B1000)
Measures how two sensor readings vary together across 999 measurements.

Standardized version

Formula
=COVARIANCE.P(A2:A50, B2:B50) / (STDEV.P(A2:A50) * STDEV.P(B2:B50))
Dividing covariance by the product of standard deviations gives the correlation coefficient — same as CORREL.

Common Errors

#N/A

Arrays have different numbers of data points.

#DIV/0!

One or both arrays contain no numeric values.

Tips

Same as COVAR

COVARIANCE.P and COVAR are identical. Use COVARIANCE.P for clearer code that explicitly states population covariance.

For samples, use COVARIANCE.S

COVARIANCE.S divides by n-1 and is appropriate for sample data. The difference is significant for small data sets.

Relationship to CORREL

CORREL = COVARIANCE.P / (STDEV.P of X * STDEV.P of Y). Correlation is just covariance normalized to a -1 to 1 scale.

Try COVARIANCE.P in Viztab

Import your data and use COVARIANCE.P with 370+ other formulas. No signup required.

Open Viztab

Related Formulas