# COVARIANCE.S

COVARIANCE.S(array1, array2)

Returns the covariance based on a sample.

 array1 The first array of integers. array2 The second array of integers.

 REMARKS
 * The covariance is the average of the products of deviations for each data point pair.* The arguments can either be numbers, arrays or cell references.* Any text, logical values or empty cells are ignored.* If "array1" and "array2" do not have the same number of elements, then #N/A is returned.* If either "array1" or "array2" is empty, then #DIV/0! is returned.* If either "array1" or "array2" contains only 1 element, then #DIV/0! is returned.* You can use the COVARIANCE.P function to return the covariance based on an entire population.* You can use the VAR.S function to return the variance based on a sample.* You can use the VARA function to return the variance based on a sample (including logical values and text).* This function was added in Excel 2010* For the Microsoft documentation refer to support.microsoft.com* For the Google documentation refer to support.google.com

 A 1 =COVARIANCE.S({10, 20, 30}, {40, 50, 60}) = 100.00 2 =COVARIANCE.S({3, 2, 4, 5, 6}, {9, 7, 12, 15, 17}) = 6.5 3 =COVARIANCE.S({3, 2, 4, 5, 6}, {9, "some text", 12, 15, 17}) = 4.5 4 =COVARIANCE.S({3, 2, 4, 5, 6}, {1, 2}) = #N/A 5 =COVARIANCE.S({3, 2, 4, 5, 6}, ) = #VALUE!