Category: FUNCTION | Updated: 2026-11-22

How to Use the RSQ Function in Google Sheets | Calculate the Coefficient of Determination (R²) for Regression Analysis

Syntax

=RSQ(data_y, data_x)
  • data_y: Specifies the cell range for the dependent data (Y-axis values).
  • data_x: Specifies the cell range for the independent data (X-axis values).

Practical Table Example

This example calculates “what proportion of sales variance can be explained by ad spend (coefficient of determination)” using ad spend (A2:A6) and sales (B2:B6) data.

Cell A (Ad Spend: 10k JPY) B (Sales: 10k JPY) C (Calculation Item) D (Formula) E (Result)
1 Ad Spend (10k JPY) Sales (10k JPY) Item Formula Result
2 10 120 Coefficient of Determination (R²) =RSQ(B2:B6, A2:A6) 0.985
3 20 185
4 30 240
5 40 310
6 50 365

The coefficient of determination is 0.985, indicating that approximately 98.5% of the variation in sales can be explained by changes in ad spend (very high linear prediction accuracy).

Common Errors and Precautions

  • Always 0 or greater: While the correlation coefficient (CORREL) becomes negative for a negative correlation, RSQ is the square of that value, so it is always a positive number between 0 and 1.
  • #N/A error: Occurs when data_y and data_x do not have the same number of cells.
  • #DIV/0! error: Occurs when there are fewer than 2 valid numeric pairs, or when all values in either dataset are identical (variance is 0).

Frequently Asked Questions

Q. What RSQ (coefficient of determination) value indicates a 'good fit'?

A. It takes a value between 0 and 1, where values closer to 1 indicate higher predictive model accuracy. While standards vary by field, in general business data, 0.7 or higher is often considered a strong fit.

Q. How is the result of the RSQ function related to the CORREL function?

A. RSQ (coefficient of determination) is exactly equal to the square of CORREL (correlation coefficient) (RSQ = CORREL^2).