RSQ Function

Excel 2007+

Summary

The RSQ function in Excel calculates the square of the Pearson product moment correlation coefficient (r²) between two sets of data points. This value represents the proportion of variance in the dependent variable (y) explained by the independent variable (x), making it essential for regression analysis and statistical modeling.

Syntax

RSQ(known_y's, known_x's)

Parameters

Parameter Type Required Description
known_y's Array/Range Yes Required array or range containing the dependent variable data points (y-values) used in the correlation calculation.
known_x's Array/Range Yes Required array or range containing the independent variable data points (x-values) used in the correlation calculation.

Using the RSQ Function

Use RSQ to evaluate the strength of linear relationships between variables. Ideal for data analysts assessing regression model performance, researchers measuring correlation strength, and business professionals analyzing variable dependencies. Returns a value between 0 (no correlation) and 1 (perfect correlation).

Common RSQ Examples

Basic Correlation Analysis

=RSQ(A2:A8,B2:B8)

Calculates R² for y-values in A2:A8 against x-values in B2:B8. Returns approximately 0.05795 for sample data showing weak correlation.

Sales vs Advertising Spend

=RSQ(B2:B13,C2:C13)

Measures how well advertising budget (C2:C13) explains sales revenue (B2:B13). Higher values indicate better predictive power.

Temperature vs Ice Cream Sales

=RSQ(A2:A20,D2:D20)

Analyzes correlation between temperature (A2:A20) and ice cream sales (D2:D20) to assess seasonal impact.

Frequently Asked Questions

An RSQ value of 0.85 means 85% of the variance in the dependent variable is explained by the independent variable, indicating strong correlation.

RSQ ignores text, logical values, and empty cells in ranges but includes zeros. Error values cause the function to return an error.

RSQ returns #N/A error if known_y's and known_x's have different numbers of data points.

Common Errors and Solutions

#N/A!

Cause: Arrays are empty or contain different numbers of data points

Solution: Ensure both ranges have identical count of numeric values

#DIV/0!

Cause: Both arrays contain only one data point

Solution: Use at least two data points for correlation calculation

#VALUE!

Cause: Arguments contain untranslatable text or error values

Solution: Clean data to contain only numbers or valid ranges

Notes

  • RSQ returns r² where r is from the PEARSON function
  • Value ranges from 0 to 1; closer to 1 indicates stronger linear relationship
  • Zeros are treated as valid data points
  • Directly typed logical values are counted in calculations

Compatibility

Available in: Excel 2007, Excel 2010, Excel 2013, Excel 2016, Excel 2019, Excel 2021, Excel 365, Excel Online

Not available in:

Content last reviewed: December 9, 2025
Update frequency: As needed
Excel versions tested: Excel 2007+