Formualizer Docs

PEARSON

Returns the Pearson correlation coefficient between two paired numeric arrays.

PEARSON reports linear association on a normalized scale from -1 to 1.

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

=PEARSON(array1, array2)

Arguments

ArgumentTypeRequiredDefault
array1number (range)Required—
array2number (range)Required—

Remarks

  • Arrays must contain the same number of numeric observations.
  • Positive values indicate positive linear association; negative values indicate inverse association.
  • Pairing and shape mismatches return spreadsheet errors from paired-array validation.

Error cases

  • Returns #DIV/0! when either array has zero variance.

Examples

Evaluate matched observations in two equally sized arrays.

Formula =PEARSON({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 =PEARSON({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 =PEARSON({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 =PEARSON({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 =PEARSON({1,2,3},{2,4,6})

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 =PEARSON({1,2,3},{3,2,1})

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?.

Implementation

Engine source

On this page