Related Function:

The RSQ function returns the square of the Pearson Product-Moment Correlation Coefficient for two supplied sets of values.

Syntax

=RSQ(array1,array2)

Arguments

Argument Description
array1 A range of cells containing a set of numeric values
array2 A range of cells containinga set of numeric values

Examples

  A B C D E F
1 Array1 Array2   Formula Result Notes
2 9 1   =RSQ(A2:A8,B2:B8) 0.063779 Square of the Pearson product moment correlation coefficient through data points in A2:A8 and B2:B8
3 37 10        
4 20 7        
5 6 5        
6 16 5        
7 9 11        
8 32 4        

Common Function Error(s)

Problem What went wrong
#N/A Occurs if the two supplied data arrays have different lengths
#DIV/0! Occurs if either of the supplied data arrays has length 1, i.e. contain just one data value

The Pearson product-moment correlation coefficient is a statistical measurement of the correlation, linear association, between two sets of values, x and y.

The equation for the correlation coefficient is:   

    \[    r = \frac { \sum(x - \bar{x})(y - \bar{y}) }{ \sqrt{ \sum(x - \bar{x})^2 \ \sum(y - \bar{y})^2 } }    \]

where x and y are the sample mean of the two arrays of values.

The RSQ function returns r^2, which is the square of this correlation coefficient.

See Wikipedia for more information on the Pearson Product-Moment Correlation Coefficient.