Function · Forecasting and trends
Excel CORREL function
The Excel CORREL function returns the Pearson correlation of two ranges. Sales that are exactly twice the ad spend correlate at 1. Reverse the sales and the correlation is -1.
Syntax =CORREL(array1, array2)
=CORREL(A2:A5,B2:B5)Arguments
| Name | Required | What to pass |
|---|---|---|
| array1 | Required | The first range. Text, blanks, and logicals are ignored, and the paired cell in array2 is ignored with them. |
| array2 | Required | The second range. It does not have to be the same shape on the sheet, but the values that remain must pair up. |
Examples
Weekly ad spend and sales that move in exact proportion
=CORREL(A2:A5,B2:B5)Result 1
| A | B | C | |
|---|---|---|---|
| 1 | Week | Ads | Sales |
| 2 | 1 | 100 | 200 |
| 3 | 2 | 200 | 400 |
| 4 | 3 | 300 | 600 |
| 5 | 4 | 400 | 800 |
| 6 | Correlation | 1 |
CORREL returns the Pearson correlation, a number from -1 to 1. Ad spend of $100, $200, $300, and $400 with sales of exactly twice that is a straight line sloping up, and the correlation is 1. Reverse the sales and the line slopes down, and the correlation is -1. Zero would mean no linear relationship. A value near 1 still does not mean the ads caused the sales. It means the two columns moved together in a straight line.
Text and blanks are dropped in pairs. A missing sales figure should be a blank in both columns or in neither, or you will pair the wrong weeks. If one column does not vary, there is nothing to correlate and the result is #DIV/0!. FORECAST.LINEAR uses the same pairs when you want a predicted number rather than the strength of the line.