WorksheetFunction.Correl(Object, Object) Method

Definition

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

public:
 double Correl(System::Object ^ Arg1, System::Object ^ Arg2);
public double Correl (object Arg1, object Arg2);
Public Function Correl (Arg1 As Object, Arg2 As Object) As Double

Parameters

Arg1
Object

A cell range of values.

Arg2
Object

A second cell range of values.

Returns

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

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

Applies to