Skip to content

Lesson 74 of 92 · Free Excel Course

Excel · Excel function reference

Excel CORREL Function: Syntax, Examples and Common Errors

How the Excel CORREL function measures correlation from -1 to 1, how to read the result, CORREL vs PEARSON and RSQ, and fixing #DIV/0! and #N/A.

The CORREL function measures how closely two columns of numbers move together. Give it two ranges of the same size and it returns the correlation coefficient (Pearson's r), a single number between -1 and 1. Near 1 means that when one column goes up, the other goes up too; near -1 means one goes up while the other goes down; near 0 means there's no straight-line pattern. CORREL works in Excel for Microsoft 365 (Windows and Mac), Excel for the web and Excel 2016 to 2024, and in older versions too.

Syntax

=CORREL(array1, array2)
  • array1 (required): the first range of numbers, such as A2:A6.
  • array2 (required): the second range, such as B2:B6. It must hold the same number of values as array1, row for row: A2 is paired with B2, A3 with B3, and so on.

There are no optional arguments. Text, TRUE/FALSE and empty cells inside the ranges are ignored, but zeros count as numbers. The order of the two ranges doesn't matter: =CORREL(B2:B6,A2:A6) gives the same answer as =CORREL(A2:A6,B2:B6).

PEARSON is the same calculation under another name: Microsoft documents both as returning the Pearson product moment correlation coefficient. RSQ returns the same number squared.

How to read the result. Look at the sign for the direction and at the size for the strength. A common rule of thumb (a convention, not an Excel rule) is that 0.7 or more, ignoring the sign, is strong, 0.3 to 0.7 is moderate and below 0.3 is weak. Correlation is not causation: a strong r only says the two columns move together, not that one makes the other happen.

Examples

1. Microsoft's example. This is the sample data from Microsoft's CORREL page. The two columns rise almost perfectly together.

D2=CORREL(A2:A6,B2:B6)
ABCD
1Data1Data2Correlation
2390.997054486
327
4412
5515
6617
Microsoft's result: 0.997054486. A value this close to 1 is a very strong positive correlation.

To check it by hand: the averages are 4 and 12. Multiply each pair's distance from its average and add them up (26), then divide by the square root of the two sums of squared distances (10 × 68 = 680). 26 / 26.077 = 0.99705.

2. A negative correlation. Average outdoor temperature against a home's gas bill for six months. As it gets warmer, the bill drops.

D2=CORREL(A2:A7,B2:B7)
ABCD
1Avg temp (°F)Gas billCorrelation
228$182-0.9914
335$160
445$121
558$85
670$52
780$40
-0.9914 (formatted to 4 decimal places): a very strong negative correlation. The minus sign means one goes up as the other goes down.

3. Almost no correlation. Height against typing speed for six people. CORREL returns about -0.07: no meaningful pattern either way.

D2=CORREL(A2:A7,B2:B7)
ABCD
1Height (in)Words/minCorrelation
26248-0.0657
36561
46739
57055
67244
77452
-0.0657 is so close to 0 that the minus sign means nothing. With only six people, small values like this are mostly chance.

4. R-squared: CORREL squared equals RSQ. Square the result from example 2 and you get R², the share of the change in the bill that a straight line through temperature explains. RSQ gives the same number in one step (note that RSQ takes the y values first).

E3=CORREL(A2:A7,B2:B7)^2
ABCDE
1Avg temp (°F)Gas billMeasureResult
228$182CORREL-0.9914
335$160CORREL squared0.9829
445$121RSQ0.9829
558$85
670$52
780$40
E4 holds =RSQ(B2:B7,A2:A7). Both say about 98% of the variation in the bill lines up with temperature.

To see it on a chart, select A1:B7, then Insert > Insert Scatter (X, Y) or Bubble Chart > Scatter. Click the chart, click the Chart Elements (+) button, tick Trendline, then open More Options and tick Display R-squared value on chart. On a linear trendline, the R² shown matches RSQ. On a Mac, use Chart Design > Add Chart Element > Trendline. In Excel for the web, trendline settings are in the chart's Format pane; if you don't see the R-squared option there, open the file in the desktop app.

Common errors

#DIV/0! One range has zero variance (every value is the same, such as a column of 5s) or holds no numbers at all. Correlation divides by each column's spread, and a spread of zero can't be divided by. Check for a constant column, or for numbers stored as text, which CORREL ignores, so the range can look full but count as empty.

#N/A. The two ranges are different sizes, such as =CORREL(A2:A7,B2:B6). Make both ranges cover the same rows. This is easy to do by accident when you add a new row to one column's range but not the other.

A wrong-looking result from a curved pattern. CORREL only measures straight-line relationships. In the grid below, y is perfectly predictable from x (it's the distance from 4, squared), yet CORREL is exactly 0 because the pattern is a U, not a line. Always look at a scatter chart before trusting r.

D2=CORREL(A2:A8,B2:B8)
ABCD
1xyCorrelation
2190
324
431
540
651
764
879
A perfect U shape gives a correlation of 0. Zero means no straight line, not no relationship.

One outlier swings the answer. In a small sample a single extreme row can push r toward 1 or 0. Check the scatter chart for points far from the rest and find out whether they're typing mistakes.

Misaligned rows. If you sort one column but not the other, the pairs no longer match and r becomes meaningless. Sort both columns together.

Related functions

Try it yourself

Open the practice workbook. The Practice sheet has Microsoft's sample data, the temperature and gas-bill months, the height and typing-speed list and two broken cases, with yellow cells for each CORREL, PEARSON, RSQ and error formula, plus a fix for the #N/A case. The Answers sheet has every formula working.

Frequently asked questions

What is the difference between CORREL and PEARSON in Excel?

Nothing you'll notice. Microsoft describes both as returning the Pearson product moment correlation coefficient, and they use the same formula, so =CORREL(A2:A6,B2:B6) and =PEARSON(A2:A6,B2:B6) give the same answer. CORREL is the more common name to use.

What is a good correlation coefficient in Excel?

It depends on the field, but a common rule of thumb is: 0.7 or more (or -0.7 or less) is strong, 0.3 to 0.7 is moderate, and under 0.3 is weak. The sign only shows the direction. These cut-offs are a convention, not something Excel calculates.

How do I get R-squared from CORREL?

Square it: =CORREL(B2:B7,A2:A7)^2. That matches =RSQ(B2:B7,A2:A7) and the R² that a linear trendline shows on a scatter chart. A correlation of -0.9914 gives an R² of 0.9829.

Why does CORREL return #DIV/0!?

One of the ranges has no variation (every number is the same) or contains no numbers at all. Correlation divides by the spread of each column, and a spread of zero can't be divided by. Check for a column of identical values or numbers stored as text.

Does correlation mean one thing causes the other?

No. CORREL only says two columns rise and fall together in a straight-line pattern. A third factor can drive both (summer raises both ice cream sales and sunburns), or it can be chance in a small sample.