RSQ in Google Sheets: Squared Correlation and Lost Direction
Calculate Google Sheets R-squared from paired data, compare residual totals and see why the same score can describe opposite linear directions.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: RSQ(data_y,data_x) returns the square of the Pearson correlation coefficient. The square removes direction, so the output cannot distinguish an increasing relationship from a decreasing one with the same correlation magnitude.
Availability and version history
- Introduced: first introduction date is not established by the reviewed official history; no desktop release number is inferred.
- Availability: documented in the rolling Google Sheets service; these examples use the web worksheet workflow.
- Checked: October 14, 2026; official RSQ reference. Documentation and independent models, with no native Sheets execution or wider client certification.
Syntax and source scope
=RSQ(data_y,data_x)
Both arrays or ranges are required. Google calls them dependent and independent data and says text is ignored. The reviewed body does not supply a complete error table or expand the coefficient equation.
These examples use complete numeric pairs and independently compute the squared Pearson model. No mixed-missingness filtering, native precision threshold or cross-product error behavior is assumed.
The residual comparison below is specifically ordinary simple regression with an intercept. It is not a universal identity for arbitrary nonlinear or zero-intercept models.
Example 1: a positive but imperfect relationship
Enter X 0,1,2,3 in A2:A5 and Y 0,2,1,3 in B2:B5:
=RSQ(B2:B5,A2:A5)
Expected result: 0.64. Both means are 1.5. Centered paired products 2.25,-0.25,-0.25,2.25 total 4. Centered squared deviations in each series total 5.
The Pearson coefficient is 4/SQRT(5*5)=0.8. Squaring gives 0.64. The control =PEARSON(B2:B5,A2:A5)^2 therefore has the same independent expectation.
A displayed 64% is a way to present 0.64. It should not be described as a 64% chance that a future prediction is correct.
Example 2: inspect the fitted-line residuals
The line for this fixture is Y=0.3+0.8*X. Fitted Y values are 0.3,1.1,1.9,2.7, and observed-minus-fitted residuals are -0.3,0.9,-0.9,0.3.
Their squared total is 1.8. The total Y squared deviation around its mean is 5, so the simple intercept-model identity gives 1-1.8/5=0.64.
This shows how the fit improves the in-sample squared-error total relative to predicting every observation with the mean. It does not establish causation or guarantee an equally good fit on new observations.
Advanced example: opposite directions have the same square
Negating Y gives 0,-2,-1,-3. The independent Pearson coefficient becomes -0.8, while RSQ remains 0.64.
A perfect increasing line at X 0,1,2,3 with Y 2,5,8,11 has RSQ 1. The decreasing line Y 11,8,5,2 also has RSQ 1. Use a signed coefficient or SLOPE when the direction matters.
Advanced example: a curve can have zero linear association
For X -2,-1,0,1,2 and Y 4,1,0,1,4, every Y is exactly X squared. Yet the centered-product sum is zero, giving expected Pearson correlation and RSQ 0.
A scatter plot would show the curve. The zero result says the centered straight-line association vanishes in this fixture; it does not prove independence or the absence of every possible relationship.
The interpretation also depends on correct pairing. Sorting only the original Y values into 0,1,2,3 would create a perfect artificial association with X and yield RSQ 1. Preserve complete rows when sorting.
Advanced check: units and origin
Transform original Y with 5*Y+10, producing 10,20,15,25. The independent RSQ remains 0.64. Reversing both original columns together also leaves the value unchanged.
A positive affine unit conversion changes the numerical slope and residual amounts but preserves this dimensionless coefficient. Changed pairings, by contrast, can alter the relationship itself.
Undefined and unverified cases
Constant inputs make the mathematical correlation denominator zero. The dedicated Google page reviewed does not identify the native error display for that condition, empty arrays, insufficient points, unequal shapes or mixed errors. These cases remain outside the worked controls.
STEYX describes residual scale in Y units, while PEARSON retains the correlation sign. Neither those functions nor RSQ chooses a study design, checks all model assumptions or produces a complete prediction interval by itself.
References and verification
Examples use fictional data, English function names and comma separators. Expected outputs are independent mathematical calculations or explicitly documented rules, not native Sheets captures. Check the spreadsheet locale when reproducing punctuation-sensitive formulas.