COVARIANCE.S Function

Excel 2010+

Summary

The COVARIANCE.S function calculates the sample covariance between two data sets, measuring how two variables change together. It returns the average of the products of paired deviations from their respective means.

Syntax

COVARIANCE.S(array1,array2)

Parameters

Parameter Type Required Description
array1 Array/Range Yes Required first array or cell range containing numeric values
array2 Array/Range Yes Required second array or cell range containing numeric values

Using the COVARIANCE.S Function

COVARIANCE.S is essential for statistical analysis in Excel, helping identify linear relationships between paired observations. Use it to understand if two variables tend to increase or decrease together.

Common COVARIANCE.S Examples

Array Input Example

=COVARIANCE.S({2,4,8},{5,11,12})

Calculates sample covariance for directly entered data points, returning 9.666666667

Cell Range Example

=COVARIANCE.S(A3:A5,B3:B5)

Same calculation using cell references instead of arrays, yielding identical result 9.666666667

Frequently Asked Questions

COVARIANCE.S uses n-1 (sample) for unbiased estimation; COVARIANCE.P uses n (population).

Yes, it ignores text, logical values, and empty cells but includes zeros.

Common Errors and Solutions

#N/A error

Cause: Arrays have different numbers of data points

Solution: Ensure both arrays contain identical count of numeric values

#DIV/0! error

Cause: Either array is empty or has only one data point

Solution: Provide at least two data points in each array

#VALUE! error

Cause: Arguments contain incompatible data types

Solution: Use only numeric values or ranges containing numbers

Notes

  • Positive result indicates variables move together
  • Negative result shows inverse relationship
  • Zero suggests no linear relationship
  • Zeros in data are included in calculation

Compatibility

Available in: Excel 2010, Excel 2013, Excel 2016, Excel 2019, Excel 2021, Microsoft 365

Not available in: Excel 2007 and earlier

Content last reviewed: December 9, 2025
Update frequency: As needed
Excel versions tested: Excel 2010+