WorksheetFunction.Covariance_S Method (Excel)

Office 2013 and later
GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Returns the sample covariance, the average of the products of deviations for each data point pair in two data sets.

expression .Covariance_S(Arg1, Arg2)

expression A variable that represents a WorksheetFunction object.

Parameters

Name

Required/Optional

Data Type

Description

Arg1

Required

Variant

Array1 - The first cell range of integers.

Arg2

Required

Variant

Array2 - The second cell range of integers.

Return Value

Double

  • The arguments must either be numbers or be names, arrays, or references that contain numbers.

  • If an array or reference argument contains text, logical values, or empty cells, those values are ignored; however, cells with the value zero are included.

  • If array1 and array2 have different numbers of data points, COVARIANCE_S returns the #N/A error value.

  • If either array1 or array2 is empty or contains only 1 data point each, COVARIANCE_S returns the #DIV/0! error value.

Show: