Going Stellar

Home/Google Sheets reference

Google Sheets function · Statistical

CORREL in Google Sheets: syntax and examples

CORREL measures how strongly two sets of numbers move together. The result runs from -1 (opposite) through 0 (no linear link) to 1 (perfect link). It does not prove that one set causes the other.

Syntax

CORREL(data_y, data_x)

Arguments

ArgumentTypeRequiredWhat it does
data_yrangeyesThe first set of values.
data_xrangeyesThe second set, with the same number of values.

Examples

The examples use this table, starting in A1:

AdsOrders
10012
20025
30031
40048
50052
=ROUND(CORREL(B2:B6, A2:A6), 3)

Result: 0.985

Ad spend against orders. A value near 1 means they rise together.

Run in a Google Sheet (English US locale) on .

=CORREL(A2:A6, A2:A6)

Result: 1

A set compared with itself is exactly 1.

Run in a Google Sheet (English US locale) on .

=CORREL(A2:A6, ARRAYFORMULA(-A2:A6))

Result: -1

Same numbers with the sign flipped: a perfect negative link, -1.

Run in a Google Sheet (English US locale) on .

=ROUND(CORREL(A2:A6, B2:B6)^2, 3)

Result: 0.97

The square of CORREL is R squared: the share of variation explained.

Run in a Google Sheet (English US locale) on .

=CORREL(A2:A6, {1;2;3;4;5})

Result: 1

Compare a column with a typed array of 1 to 5.

Run in a Google Sheet (English US locale) on .

Common errors

  • Both sets need the same number of values. Different lengths return #N/A.
  • If one set never changes, the correlation is undefined and the result is #DIV/0!.
  • A value near 0 means no straight-line link, not no link at all. Plot the data before concluding.

Compared with Excel

Same syntax and same result as Excel CORREL.

Sources

  1. CORREL (Docs Editors Help)

Markdown version · All functions