Statistical function

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)
ArgumentWhat it means
array1RequiredThe first set of values (e.g. temperature).
array2RequiredThe 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

D2fx=PEARSON(A2:A7, B2:B7)
ABCD
1Temp (°C)Ice-cream sales
2142100.9974
318260
422345
526400
630455
733520

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

D2fx=PEARSON(A2:A7, B2:B7)
ABCD
1Temp (°C)Hot drink sales
214180-0.9963
318160
422130
526118
63090
73372

Result: -0.9963

r = -0.996277 (shown to 4 decimals). The minus sign shows hot drinks sell less as temperature rises.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 14 KB

Common errors and how to fix them

ErrorWhy it happensFix
#N/AThe 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.