The coefficient r (Pearson correlation coefficient) in Google Sheets is calculated with the CORREL function: =CORREL(range1, range2). For example, =CORREL(A2:A10, B2:B10) returns a value between -1 and 1 that measures the strength and direction of the linear relationship between two data sets.
What the Coefficient r Measures
The Pearson r is a standardized measure of linear association. A value of 1 means a perfect positive linear relationship (as one variable increases, the other increases proportionally), -1 means a perfect negative linear relationship, and 0 means no linear relationship. It does not capture curved (non-linear) patterns, and it is sensitive to outliers.
In Google Sheets, the CORREL function uses the same underlying formula as the PEARSON function—they are interchangeable. The mathematical definition is the covariance of the two variables divided by the product of their standard deviations.
How to Use CORREL in Google Sheets
- Enter your two data sets in adjacent columns (e.g., A and B).
- Click an empty cell where you want the result.
- Type
=CORREL(then select the first range (e.g.,A2:A10), type a comma, select the second range (B2:B10), and close with). - Press Enter. The cell shows the r value.
Example: With exam scores in A2:A10 and study hours in B2:B10, =CORREL(A2:A10, B2:B10) might return 0.85, indicating a strong positive correlation. If it returns -0.3, that suggests a weak negative relationship.
CORREL vs. PEARSON vs. RSQ
Google Sheets offers three related functions:
CORRELandPEARSONboth return the correlation coefficient r. They are identical in result.RSQreturns the square of r (r²), the coefficient of determination. This tells you the proportion of variance in one variable explained by the other. For example, if r = 0.8, RSQ = 0.64, meaning 64% of the variation is shared.
Use RSQ when you want to explain variance, and CORREL when you want the signed r value for reporting.
Interpreting the Result Correctly
Correlation does not imply causation. A high r only indicates that the two variables move together linearly; it does not prove that one causes the other. Also, the strength is often categorized loosely:
- 0.00–0.19: very weak
- 0.20–0.39: weak
- 0.40–0.59: moderate
- 0.60–0.79: strong
- 0.80–1.00: very strong
These thresholds are arbitrary; always consider the context of your data. A correlation of 0.5 might be meaningful in physics but weak in social sciences.
Common Errors and How to Fix Them
- #N/A error: The two ranges have different numbers of cells. Ensure both ranges are the same size.
- #DIV/0! error: One of the ranges has zero variance (all values identical). Correlation is undefined when a variable is constant.
- Text or empty cells: CORREL ignores text and empty cells, but if a cell contains a non-numeric value, it may be skipped. If you have blanks, they are ignored, but if you have errors (#REF!, etc.) in the range, the function returns an error.
- Outliers: A single extreme value can dramatically affect r. Consider checking a scatter plot (Insert > Chart) to visually inspect the relationship.
When Not to Use Coefficient r
Pearson r assumes a linear relationship and roughly normally distributed data. If your data shows a curved pattern (e.g., exponential growth), r may be near zero even though a strong relationship exists. In such cases, consider transforming the data (e.g., log transform) or using a non-linear correlation measure. Also, if your data is ordinal (ranked), use Spearman’s rank correlation instead—Google Sheets does not have a built-in Spearman function, but you can rank the data with RANK and then apply CORREL to the ranks.
Frequently Asked Questions
What is the difference between CORREL and PEARSON in Google Sheets? They are functionally identical—both return the Pearson correlation coefficient. You can use either; CORREL is more commonly used because it is shorter.
Can I calculate r for more than two variables? No, CORREL only works with two ranges. For multiple variables, you would need to create a correlation matrix using the CORREL function repeatedly or use the Analysis Toolpak add-on (not built-in).
How do I find r² in Google Sheets? Use the RSQ function: =RSQ(A2:A10, B2:B10). It returns the square of the correlation coefficient.
Does CORREL work with non-numeric data? No, it requires numeric data. Text is ignored, but if a cell contains text, it is skipped; if all cells are text, you get an error.
Is there a way to visualize the correlation? Yes, create a scatter chart: select the two columns, go to Insert > Chart, and in the Chart editor choose “Scatter chart”. This helps you see the relationship and spot outliers.
Why is my CORREL result #DIV/0!? This happens when one of the ranges has zero variance (e.g., all values are the same). Correlation requires variability in both variables.
Related
- How to Add a Bold Border in Excel
- Data Entry Job for Student Free? Honest Answer
- How to Generate a Random Number on a TI-84
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- How to Record an Entire PowerPoint PresentationTo record an entire presentation in PowerPoint, open it in the desktop app, choose Record > From Beginning,…
- Polynomial Solver in Excel: Methods, Limits, and TipsExcel has no built-in command that symbolically solves every polynomial, but you can find real roots with the…
- Add a Zero Before a Number in Excel Without Losing ItTo add a zero before a number in Excel, enter it as text (type an apostrophe first, such…
- Add a Custom Number Format in Excel: Steps & ExamplesTo add a custom number format in Excel for Microsoft 365 on Windows, select the cells, press Ctrl+1,…
- How to Hide Columns in Excel on Mac Without Losing DataTo hide columns in Excel on a Mac, select the column letter or letters, then choose Home >…
- Contact List Excel Example and Setup GuideA useful contact list Excel example has one person per row and clear columns for name, phone, email,…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.