Practice free

COVARIANCE.S function

COVARIANCE.S works like COVARIANCE.P but divides by n-1, which is the right choice when your data is a sample from a larger group. It needs at least two data points.

Example

Read it as a sentence: find how the values in G1:G5 and F1:F5 vary together, treating them as a sample.

Practice this in the app

Syntax

COVARIANCE.S(array1, array2)

array1 (required)
First set of values.
array2 (required)
Second set, same size.

Returns: The sample covariance of two data sets.

What Excel actually returns

Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.

FormulaExcel showsCase
=COVARIANCE.S({2,4,5,4,5},{1,2,3,4,5}) 1.5 Array constants
=COVARIANCE.S(Data!G1:G5,Data!F1:F5) 1.5 Two ranges (y,x order as written)
=COVARIANCE.S(Data!I1:I5,Data!H1:H5) 3 Blank and text-number pairs dropped
=COVARIANCE.S(Data!G1:G5,Data!J1:J5) 0 Constant x
=COVARIANCE.S(Data!G1:G2,Data!F1:F2) 1 Two pairs
=COVARIANCE.S({2,4,5,4,5},Data!F1:F5) 1.5 Row vs column same count
=COVARIANCE.S(Data!G1:G5,Data!K1:K3) #N/A Different sizes
=COVARIANCE.S(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.

Watch out for

  • Needs at least two data points.
  • Arrays must be the same size or you get #N/A.

Where it works

Excel
COVARIANCE.S arrived in Excel 2010. Older versions do not have it.
Google Sheets
Same name, same behaviour for everyday use.

Part of Statistical functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .