The coefficient r (Pearson correlation coefficient) in Google Sheets is calculated with the CORREL function: =CORREL(range1, range2). It returns a value between -1 and 1 that shows how strongly two sets of data move together. For example, if your exam scores are in A2:A20 and study hours are in B2:B20, enter =CORREL(A2:A20, B2:B20) in any empty cell to get the r value.
What the Coefficient r Actually Measures
The Pearson r measures the linear relationship between two variables. An r of 1 means a perfect positive linear relationship (as one increases, the other increases proportionally). An r of -1 means a perfect negative relationship. An r of 0 means no linear relationship at all. It does not measure the slope of the line, nor does it prove causation. Two variables can have a high r purely by coincidence or because a third variable drives both.
For example, if you compare ice cream sales (column A) with drowning incidents (column B) over a year, you might get r ≈ 0.9. That does not mean ice cream causes drowning; both rise in summer. The coefficient only tells you they move together, not why.
How to Use CORREL in Google Sheets
The syntax is simple: =CORREL(data_y, data_x). Google Sheets does not care which is which for the result, but convention puts the dependent variable first. Steps:
- Open your spreadsheet in a web browser.
- Click an empty cell where you want the r value.
- Type
=CORREL(then select the first data range, type a comma, select the second range, and close the parenthesis. - Press Enter. The cell shows the r value, usually formatted to many decimals. Use Format > Number > Number to reduce decimals if needed.
Both ranges must be the same length. If they are not, CORREL returns a #N/A error. Also, all values must be numeric; text or empty cells in the middle of a range will cause errors or be ignored depending on how you structure the ranges.
Choosing the Right Ranges and Handling Missing Data
You should only include paired observations. If you have a blank cell in one column but not the other, CORREL will treat the blank as a missing pair and return an error. To handle this, you can use FILTER to exclude rows with blanks:
With data in A2:A20 and B2:B20, use: =CORREL(FILTER(A2:A20, ISNUMBER(A2:A20), ISNUMBER(B2:B20)), FILTER(B2:B20, ISNUMBER(A2:A20), ISNUMBER(B2:B20)))
This filters both ranges to only rows where both cells are numbers. The result is the r for complete pairs only. If your data has outliers, consider whether they are errors. CORREL is sensitive to outliers; a single extreme value can dramatically change r. You might want to visually inspect a scatter plot first (Insert > Chart, then choose Scatter chart).
Interpreting the r Value in Context
There is no universal cutoff for a “strong” correlation, but common rough guides are:
- |r| between 0 and 0.3: weak or no linear relationship
- |r| between 0.3 and 0.7: moderate relationship
- |r| between 0.7 and 1.0: strong relationship
These are heuristics, not rules. The significance of r depends on sample size. With only 5 data points, an r of 0.9 could happen by chance. With 100 points, an r of 0.2 might be statistically significant. To test significance, you would need a p-value, which CORREL does not provide. You can compute a t-statistic manually: t = r * SQRT((n-2)/(1-r^2)) where n is the number of pairs. But for most everyday uses, the raw r plus a scatter plot is enough.
Common Problems and Errors with CORREL
Here are the most frequent issues users run into:
- #N/A error: The two ranges have different lengths, or there are blank cells in either range. Fix by using equal-sized ranges or the FILTER approach above.
- #DIV/0! error: One of the ranges has zero variance (all values identical). Correlation is undefined when there is no variation. Check your data for a column that is constant.
- Wrong sign: If your r is positive when you expected negative, check that you did not reverse the columns. The sign depends on which variable increases with the other; reversing the order of the same two columns does not change the sign, but selecting the wrong columns does.
- Text or non-numeric values: CORREL ignores text and logical values, but only if they are not mixed into the numeric range in a way that breaks the pairing. Best to keep data clean.
CORREL vs. PEARSON vs. RSQ
Google Sheets has three related functions:
CORREL– returns r, the correlation coefficient.PEARSON– does exactly the same thing as CORREL. They are interchangeable in Google Sheets.RSQ– returns r², the coefficient of determination. This tells you what percentage of the variance in one variable is explained by the other. For example, if r = 0.8, then RSQ = 0.64, meaning 64% of the variation in y is explained by x.
Use CORREL when you want the r value itself. Use RSQ when you want to report how much variance is explained. PEARSON is just a legacy name; you can use either CORREL or PEARSON and get the same result.
Alternatives: Scatter Plots and Trendlines
Sometimes a number is not enough. To see the relationship visually, create a scatter plot: select both columns, go to Insert > Chart, and in the Chart editor choose “Scatter chart” under Chart type. Then add a trendline by clicking the chart, going to Customize > Series, and checking “Trendline.” The trendline’s equation and R² value (which is r²) will appear on the chart. This gives you both the visual pattern and the numeric fit. Note that the R² shown on a trendline is the same as RSQ for a linear trendline; if you choose a polynomial or exponential trendline, the R² will differ and is not the Pearson r.
Frequently Asked Questions
Can CORREL handle more than two columns at once? No. CORREL only compares two ranges. To get a full correlation matrix for multiple variables, you would need to enter CORREL for each pair separately, or use the Data Analysis add-on (Extensions > Add-ons > Get add-ons and search for “Analysis Toolpak” – though that is more common in Excel). In Google Sheets, you can build a small table of formulas manually.
Does the order of arguments matter? No. =CORREL(A1:A10, B1:B10) gives the same result as =CORREL(B1:B10, A1:A10). The correlation is symmetric.
What if my data has outliers? CORREL is very sensitive to outliers. A single extreme point can make a weak correlation look strong or hide a strong one. Always plot your data first. If you suspect an outlier is a data entry error, fix it or remove that row before calculating. If the outlier is real, consider reporting both r with and without it.
Is r the same as the slope of the regression line? No. The slope depends on the units of your variables. r is unitless and always between -1 and 1. For example, if x is height in cm and y is weight in kg, the slope might be 0.5 kg/cm, but r could be 0.8. They measure different things: slope is the change in y per unit change in x, while r is the strength of the linear association.
Can I use CORREL with dates or times? Yes, as long as they are stored as numbers (which dates and times are in Sheets). For example, comparing dates (as serial numbers) with sales figures works fine. Just be aware that the r will reflect the linear trend over time, not the calendar meaning.
Related
- Data Entry Role Description: Duties, Skills, Salary
- How to Add Bullets in Excel (3 Quick Ways)
- How to Add Bottom Border in Excel
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Shortcut to Switch Off Computer: Fastest WaysThe fastest universal shortcut to switch off a Windows computer is Alt+F4 on the desktop, which opens the…
- Basic Excel Table With Data: How to Build and Use OneA basic Excel table with data is a rectangular set of related records organized under a single header…
- Correlation Analysis in Excel: Methods and ExamplesTo run a correlation analysis in Excel, place two comparable numeric variables in separate columns and use =CORREL(A2:A6,B2:B6),…
- Location Heat Map in Excel: How to Build OneYou can make a location heat map in Excel for Microsoft 365 on Windows with 3D Maps: put…
- How to Change Your Outlook Inbox View and Layout SettingsTo change how your Outlook inbox looks, open the view or layout controls for your version of Outlook,…
- How to Sort by Date in Google SheetsTo sort dates in Google Sheets, select the entire table, choose Data > Sort range > Advanced range…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.