Google Sheets CORREL Function: How to Use It
In this article
The CORREL function in Google Sheets calculates the Pearson correlation coefficient between two ranges of numbers. It returns a value between -1 and 1 that shows how strongly two variables move together: 1 means perfect positive correlation, -1 means perfect negative correlation, and 0 means no linear relationship. To use it, type =CORREL(range1, range2) in a cell, replacing each range with a set of numbers of the same size. Both ranges must contain numbers only; text or empty cells cause errors. The result tells you the direction and strength of a linear trend, but not causation.
What You'll Need
- A Google account and access to Google Sheets (desktop browser or the mobile app; the steps below use the desktop browser, but the formula is identical in the app).
- Two columns (or rows) of numeric data with the same number of data points.
- Basic familiarity with entering formulas and selecting cell ranges.
Step-by-Step
- Open your spreadsheet. Go to Google Sheets and open the file containing your data, or create a new blank sheet and paste your data into two columns (for example, column A for variable X and column B for variable Y).
- Check your data. Ensure both columns have the same number of rows and contain only numbers. Remove or replace any text, blank cells, or error values (like #N/A) in the ranges you plan to use. If a cell is empty, CORREL may ignore the entire row pair or return an error depending on the range; safest is to have complete numeric pairs.
- Select the cell for the result. Click an empty cell where you want the correlation coefficient to appear, for example cell D2.
- Type the formula. Enter
=CORREL(then select your first range. You can drag to select the cells or type the range likeA2:A20. Type a comma, then select the second range (e.g.,B2:B20), and close the parenthesis. The full formula looks like=CORREL(A2:A20, B2:B20). - Press Enter. The cell will display the correlation coefficient. A positive value means as one variable increases, the other tends to increase; a negative value means as one increases, the other tends to decrease. The closer to ±1, the stronger the linear relationship.
- Format the result (optional). To show more decimal places, select the cell, click the Format menu, choose Number, then Number format, and adjust decimal places. This helps interpret small differences.
- Verify with a chart (optional). Create a scatter chart from your two columns to visually confirm the relationship. Select both columns, click Insert > Chart, and choose Scatter chart. The visual pattern should match the sign and rough strength of the CORREL result.
Common Mistakes
- Unequal range sizes. CORREL requires both ranges to have the same number of cells. If one range has 10 cells and the other 12, you'll get a #N/A error.
- Including text or blanks. If either range contains text, logical values, or empty cells, CORREL may return an error or ignore pairs. Ensure all cells in both ranges are numeric.
- Using entire columns. Referring to whole columns like
A:AandB:Bcan include header text and empty rows, causing errors. Use specific ranges likeA2:A100. - Misinterpreting correlation as causation. A high correlation does not mean one variable causes the other; there may be a third factor or coincidence.
- Expecting non-linear relationships to show. CORREL only measures linear association. A perfect curved relationship can yield a coefficient near zero.
Tips
- Use named ranges to make formulas easier to read: select your data, click Data > Named ranges, and define a name. Then use
=CORREL(Sales, AdSpend). - Check for outliers; a single extreme value can dramatically change the correlation coefficient. Consider creating a scatter chart to spot them.
- If you need to correlate more than two variables, calculate pairwise correlations or use the CORREL function in combination with other functions.
- Remember that correlation strength guidelines are informal: absolute values below 0.3 are often considered weak, 0.3–0.7 moderate, and above 0.7 strong, but this depends on context.
- Use the
CORRELfunction with dynamic ranges (e.g., usingFILTERorQUERY) to analyze subsets without manually adjusting ranges.
Troubleshooting
If you get a #N/A error, check that both ranges have the same number of cells and contain only numbers. If you see #DIV/0!, one or both ranges may have zero variance (all values identical) or fewer than two data points. Ensure your ranges include at least two pairs of numbers. If the result seems wrong, verify that you haven't swapped ranges accidentally or included header rows. For #VALUE!, confirm that no cells contain text; even a single text cell in the range can cause this. If the formula returns a number but you expected a different sign, double-check the order of ranges: CORREL is symmetric, so swapping ranges doesn't change the result, but misalignment of data pairs can. Always align your data so that each row represents the same observation.
Frequently Asked Questions
What is the difference between CORREL and PEARSON in Google Sheets?
Both functions calculate the Pearson correlation coefficient and return identical results. CORREL is more commonly used and is compatible with Excel.
Can CORREL handle blank cells?
If a cell in either range is blank, CORREL may ignore that pair or return an error depending on the range. It's best to have complete numeric data.
Does CORREL work with non-numeric data?
No, CORREL requires numeric values. Text or logical values will cause errors.
How many data points do I need for a meaningful correlation?
At least two pairs are required for the calculation, but meaningful interpretation typically requires a larger sample. The reliability increases with more data points.
Can I use CORREL with data in different sheets?
Yes, you can reference ranges from other sheets using the sheet name, e.g., =CORREL(Sheet1!A2:A20, Sheet2!B2:B20).
Is there a way to calculate correlation for multiple pairs at once?
Not directly with a single CORREL formula, but you can use the ARRAYFORMULA with CORREL for each pair or create a correlation matrix using other functions.