WorksheetFunction.Covariance_S Method

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

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
Function Covariance_S ( _
    Arg1 As Object, _
    Arg2 As Object _
) As Double
'Usage
Dim instance As WorksheetFunction
Dim Arg1 As Object
Dim Arg2 As Object
Dim returnValue As Double

returnValue = instance.Covariance_S(Arg1, _
    Arg2)
double Covariance_S(
    Object Arg1,
    Object Arg2
)

Parameters

  • Arg1
    Type: System.Object

    Array1 - The first cell range of integers.

  • Arg2
    Type: System.Object

    Array2 - The second cell range of integers.

Return Value

Type: System.Double

Remarks

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.

See Also

Reference

WorksheetFunction Interface

WorksheetFunction Members

Microsoft.Office.Interop.Excel Namespace