CORREL
Returns the Pearson correlation coefficient between two numeric arrays.
CORREL measures linear relationship strength from -1 (perfect inverse) to 1 (perfect
direct).
The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.
Syntax
=CORREL(array1, array2)
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
array1 | number (range) | Required | — |
array2 | number (range) | Required | — |
Remarks
- Both arrays must produce the same number of numeric values.
Error cases
- Returns
#N/Awhen array lengths differ. - Returns
#DIV/0!when either series has zero variance.
Examples
Evaluate matched observations in two equally sized arrays.
Formula =CORREL({1,2,3,4},{1,4,5,7})
Expected result 0.981155781039212
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Reverse the second series to compare opposite movement.
Formula =CORREL({1,2,3,4},{7,5,4,1})
Expected result -0.981155781039212
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Use two observations that follow a perfect positive linear pattern.
Formula =CORREL({1,2},{2,4})
Expected result 1
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Each observation needs a partner in the other array.
Formula =CORREL({1,2,3,4},{1,4,5})
Expected result #N/A
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Perfect positive linear correlation
Formula =CORREL({2,4,6},{1,2,3})
Expected result 1
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Perfect negative linear correlation
Formula =CORREL(A1:A3,B1:B3)
| A | B | |
|---|---|---|
| 1 | 10 | 1 |
| 2 | 8 | 2 |
| 3 | 6 | 3 |
Expected result -1
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.