CORREL Function in Excel: Step-by-Step Guide
In this article
The CORREL function in Excel calculates the Pearson correlation coefficient between two sets of numbers, returning a value between -1 and 1 that shows how strongly they move together. To use it, type =CORREL(array1, array2) into a cell, replacing each argument with a range of cells that contain your two variables. Both ranges must be the same size, contain at least two numbers each, and line up row for row so that each pair of values belongs to the same observation.
What You'll Need
- Excel on Windows, Mac, or Excel for the web (the function works the same on all three).
- Two columns or rows of numeric data, with one value per observation in each set.
- Your data arranged so that the first value in one range corresponds to the first value in the other range.
- No blank cells, text, or error values inside the ranges you plan to select (or you will need to handle them first).
Step-by-Step
- Lay out your data in pairs. Put one variable in column A and the other in column B, starting at the same row. For example, A2:A11 could hold hours studied and B2:B11 could hold test scores, with row 2 being the same student in both columns. The pairing is what makes the result meaningful.
- Click an empty cell where you want the correlation coefficient to appear, ideally outside both data ranges.
- Type the formula. Enter =CORREL( and then select the first range with your mouse or type it, for example A2:A11. Type a comma, then select the second range, for example B2:B11. Close the parenthesis so the formula reads =CORREL(A2:A11,B2:B11).
- Press Enter. The cell shows a number between -1 and 1. A value near 1 means the two variables rise together; near -1 means one rises while the other falls; near 0 means little or no linear relationship.
- Check the sign and magnitude. A result of 0.85 is a strong positive correlation, -0.85 is a strong negative correlation, and 0.05 is essentially no linear correlation. There is no universal cutoff for strong or weak; it depends on your field and sample size.
- Format the result if you like. Select the cell, then use the Number Format dropdown on the Home tab to show more decimal places. The underlying value does not change.
- Test with a second pair (optional). Copy the formula to another cell and change the ranges to compare other variables. Keep the two ranges the same length every time.
Common Mistakes
- Mismatched range sizes. If one range has 10 cells and the other has 12, Excel returns the #N/A error. Count the rows or use the same drag selection for both.
- Misaligned pairs. Selecting A2:A11 and B3:B12 pairs the wrong observations together and gives a meaningless coefficient, even though Excel returns a number without complaint.
- Including text or blanks. Text and empty cells are ignored, which can silently shrink the effective sample and shift the result. Clean the data or use a helper column first.
- Confusing correlation with causation. A high coefficient does not prove one variable causes the other; a third factor may drive both.
- Using CORREL on non-linear relationships. The function measures linear association only. A perfect curve such as a parabola can still return a coefficient near zero.
- Expecting it to handle filtered rows. CORREL uses the cells you give it, including hidden rows. If you filter data, the hidden rows are still counted.
Tips
- Use named ranges (Formulas > Name Manager) to make formulas like =CORREL(Hours, Scores) easier to read and audit.
- Pair CORREL with a scatter chart (Insert > Scatter) so you can see the shape of the relationship before trusting the number.
- If you need the coefficient for many pairs at once, the Data Analysis ToolPak includes a Correlation tool that produces a matrix. Enable it via File > Options > Add-ins > Excel Add-ins > Go, then tick Analysis ToolPak.
- Round only for display. Keep the full-precision value in the cell if you plan to use it in further calculations.
- Remember that a small sample can produce a large coefficient by chance; interpret with care when you have only a handful of pairs.
Troubleshooting
- #N/A error: The two ranges have different numbers of cells, or one range is empty. Make them identical in size and re-enter the formula.
- #DIV/0! error: One of the ranges has zero variance (all values identical) or fewer than two numeric values. Check for a column of the same number repeated.
- #VALUE! error: A range contains something Excel cannot treat as a number in a way that breaks the calculation, or the arguments are not ranges. Remove stray text or convert numbers stored as text.
- Result looks wrong: Confirm the pairs line up row by row, that no rows are hidden and still included, and that you have not accidentally selected a header row containing text.
- Formula will not calculate: Check that Calculation Options is set to Automatic (Formulas > Calculation Options). If it is set to Manual, press F9 to recalculate.
- If that did not work: Rebuild the formula from scratch in a clean cell, selecting each range with the mouse rather than typing it, and confirm the result against a scatter chart of the same data.
Frequently Asked Questions
What is the difference between CORREL and PEARSON?
They calculate the same Pearson correlation coefficient. CORREL is the more commonly used name in Excel; PEARSON is kept for compatibility.
Can CORREL handle more than two ranges?
No. It accepts exactly two arrays. To compare several variables, run CORREL once per pair or use the Correlation tool in the Analysis ToolPak.
Does CORREL work on filtered or hidden rows?
Yes, it includes them. Hidden rows are still part of the range, so filter your data into a new location if you want the coefficient calculated on visible rows only.
What does a correlation of 0 mean?
It means there is no linear relationship between the two variables. There could still be a non-linear pattern, which a scatter chart would reveal.
Why do I get #N/A even though both ranges look the same size?
One range may contain a blank cell that Excel treats as missing, or the ranges may differ by a row due to a header. Select each range separately and check the cell count in the Name Box.
Is CORREL available in Excel for the web and Google Sheets?
Yes, CORREL is available in Excel for the web and in Google Sheets with the same syntax. Results should match when the data and ranges are identical.