The formula is =CORREL(array1, array2). Everything below covers what that leaves out: the p value, the confidence interval, Spearman, and the correlation matrix.
Put one variable in a column, the other in the column beside it, and enter:
=CORREL(A2:A13, B2:B13)
That returns Pearson's r, a number from -1 to +1. =PEARSON(A2:A13, B2:B13) returns the identical value. Excel keeps both for historical reasons.
Twelve students, hours studied against exam score.
| Row | A: Hours | B: Score |
|---|---|---|
| 2 | 2 | 57 |
| 3 | 3 | 69 |
| 4 | 4 | 56 |
| 5 | 5 | 63 |
| 6 | 6 | 50 |
| 7 | 7 | 75 |
| 8 | 8 | 71 |
| 9 | 9 | 81 |
| 10 | 10 | 69 |
| 11 | 11 | 76 |
| 12 | 12 | 80 |
| 13 | 13 | 77 |
=CORREL(A2:A13, B2:B13).For the proportion of shared variance, use =RSQ(B2:B13, A2:A13), which gives 0.52. Note the argument order: RSQ takes the y values first, the opposite of CORREL's symmetry. Squaring the CORREL result gets you to the same place.
This is the gap that matters. CORREL, PEARSON, and the Analysis ToolPak all hand back a coefficient and stop. An r of .72 from twelve students and an r of .72 from twelve hundred are not the same finding, and Excel shows you the same number for both.
Two extra cells close it. With r in cell D1 and n = 12:
D2: =D1*SQRT(12-2)/SQRT(1-D1^2)
D3: =T.DIST.2T(ABS(D2), 12-2)
D2 is the t statistic, 3.28. D3 is the two-tailed p value, 0.008. So the correlation is significant at the .05 level, and now you can report it.
On Excel 2007 and earlier, the function is =TDIST(ABS(D2), 10, 2) instead.
The interval requires a Fisher z transformation, an inverse normal, and a transformation back. It is four more cells of arithmetic and easy to get subtly wrong.
For the data above the 95% interval runs from .25 to .92. Worth seeing. An r of .72 sounds settled until the interval shows the population value could plausibly be .25. Twelve students do not pin down much, and the coefficient alone hides that.
Skip the extra cells. Paste the same two columns into the correlation calculator and get r, r², the exact p value, the confidence interval, and an APA 7 write-up in one step.
Open the correlation calculatorExcel has no Spearman function. Rank each variable first, then correlate the ranks.
=RANK.AVG(A2, $A$2:$A$13, 1) and fill down.=RANK.AVG(B2, $B$2:$B$13, 1) and fill down.=CORREL(C2:C13, D2:D13), which returns 0.75 for this data.Use RANK.AVG, not RANK.EQ. Spearman requires tied values to share the average of the ranks they span. RANK.EQ assigns them all the lowest rank in the tie and leaves gaps, which shifts the coefficient whenever ties exist. With no ties the two agree, which is how the mistake survives unnoticed until it matters.
For more than two variables, the Analysis ToolPak does it in one pass.
Excel returns a lower triangle of Pearson coefficients. No p values, no sample sizes, no significance markers, and no option for Spearman. For a matrix you intend to publish, that means adding every p value by hand, once per pair, which is where transcription errors get in.
Doing this on a Mac more than once? ReliCheck Quanta builds full correlation matrices with p values, significance markers, scatterplots, and APA tables from your raw data. Free to try.
Get Quanta