PEARSON function
Returns the Pearson correlation coefficient r, measuring how strongly two sets of values move together in a straight line.
Available in All versions of Excel, including Microsoft 365 and Excel for the web
In every Excel versionWorks in Google Sheets
Syntax
PEARSON(array1, array2)| Argument | What it means | |
|---|---|---|
array1 | Required | The first set of values (e.g. temperature). |
array2 | Required | The second set of values, with the same number of points. |
Returns: A number from -1 to 1.
How PEARSON works
Do two things go up and down together? The Pearson correlation coefficient puts a number on it. A value near +1 means a strong positive linear link (as one rises, so does the other), near -1 a strong negative link (one rises as the other falls), and near 0 no straight-line relationship. Typical questions: does ice-cream revenue follow temperature, do longer training hours go with higher test scores?
PEARSON returns exactly the same value as CORREL; the two exist for historical reasons. Squaring the result gives RSQ, the share of variation one variable explains in the other. Two cautions: correlation is not causation (both could be driven by a third factor), and it only measures straight-line relationships; a perfect U-shape can have r ≈ 0. Pairs containing text, logical values or empty cells are ignored.
Examples
1Temperature and ice-cream sales
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Temp (°C) | Ice-cream sales | ||
| 2 | 14 | 210 | 0.9974 | |
| 3 | 18 | 260 | ||
| 4 | 22 | 345 | ||
| 5 | 26 | 400 | ||
| 6 | 30 | 455 | ||
| 7 | 33 | 520 |
Result: 0.9974
r = 0.997358 (shown to 4 decimals): a very strong positive relationship. Warmer days go with higher sales almost perfectly along a straight line.
2A negative correlation
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Temp (°C) | Hot drink sales | ||
| 2 | 14 | 180 | -0.9963 | |
| 3 | 18 | 160 | ||
| 4 | 22 | 130 | ||
| 5 | 26 | 118 | ||
| 6 | 30 | 90 | ||
| 7 | 33 | 72 |
Result: -0.9963
r = -0.996277 (shown to 4 decimals). The minus sign shows hot drinks sell less as temperature rises.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#N/A | The arrays have different numbers of values. | Use ranges of the same size. |
#DIV/0! | One of the arrays has no variation (all values equal) or is empty. | Correlation needs values that vary. |
Tips
- Rough guide: |r| above 0.7 strong, 0.4–0.7 moderate, below 0.3 weak; but always look at a scatter chart too.
- One outlier can create or destroy a correlation; check the chart before trusting r.
Google Sheets
PEARSON also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.