WorksheetFunction.Correl Method

Returns the correlation coefficient of the Arg1 and Arg2 cell ranges.

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

Syntax

'Declaration
Function Correl ( _
    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.Correl(Arg1, Arg2)
double Correl(
    Object Arg1,
    Object Arg2
)

Parameters

Return Value

Type: System.Double

Remarks

Use the correlation coefficient to determine the relationship between two properties. For example, you can examine the relationship between a location's average temperature and the use of air conditioners.

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 Arg1 and Arg2 have a different number of data points, Correl generates an error.

If either Arg1 or Arg2 is empty, or if s (the standard deviation) of their values equals zero, Correl generates an error.

The equation for the correlation coefficient is:

Figure 1: Equation for the correlation coefficient

Equation for the correlation coefficient

where x and y are the sample means Average(Arg1) and Average(Arg2).

See Also

Reference

WorksheetFunction Interface

WorksheetFunction Members

Microsoft.Office.Interop.Excel Namespace