# The Excel CORREL Function

Pearson Product-Moment Correlation Coefficient

The Pearson product-moment correlation coefficient is a statistical measurement of the correlation (linear association) between two sets of values.

The Pearson product-moment correlation coefficient for two sets of values, x and y, is given by the formula: where x and y are the sample means of the two arrays of values.

If the value of r is close to +1, this indicates a strong positive correlation, and if r is close to -1, this indicates a strong negative correlation.

Further information on the Pearson Product-Moment Correlation Coefficient is provided on Wikipedia

## Function Description

The Excel Correl function calculates the Pearson Product-Moment Correlation Coefficient for two sets of values.

The syntax of the function is:

CORREL( array1, array2 )

Where array1 is a set of independent variables and array2 is a set of dependent variables. These arrays should be of equal length.

Note that the Correl function ignores text values and logical values that are supplied as part of an array.

### Excel Correl Function vs. Excel Pearson Function

The Excel Correl function is the same as the Excel Pearson Function, except that, in earlier versions of Excel (earlier than Excel 2003), the Pearson function may exhibit some rounding errors.

Therefore, if you are using an earlier version of Excel, you should use the Correl function in preference to the Pearson function. In later versions of Excel, both functions should give the same results.

## Excel Correl Function Example

AB
1xy
2222.90
31045.78
4733.49
51749.77
61440.94
71636.18
8821.05
91250.57
101131.32
111553.76
121855.66
13327.61
14411.15
15110.11
16637.90
17531.08
181345.48
191963.83
202063.60
21927.01

Columns A and B of the above spreadsheet on the right contain two arrays of values. These are plotted in the chart below: The Pearson Product-Moment Correlation Coefficient of the values in columns A and B of the spreadsheet can be calculated using the Excel Correl function, as follows:

=CORREL( A2:A21, B2:B21 )

This gives the result 0.870035104, which indicates a strong positive correlation between the two sets of values.

The University of Connecticut website provides a useful table showing the significance of the Pearson Product-Moment Correlation Coefficient.

For further details and examples of the Excel Correl function, see the Microsoft Office website.

## Correl Function Errors

If you get an error from your Excel Correl function this is likely to be one of the following:

Common Errors
 #N/A - Occurs if the supplied arrays are of different lengths. #DIV/0! - Occurs if either of the supplied arrays are empty or if the standard deviation of their values equals zero.