The RSQ function is a powerful tool within Microsoft Excel that assesses the degree of correlation between a set of observed and predicted values. It focuses on measuring the goodness of fit in linear regression analysis by returning the square of the correlation coefficient, which ranges from 0 to 1. A value closer to 1 indicates a strong linear relationship, while a value closer to 0 suggests a weak relationship.
Syntax
The syntax for the RSQ function is as follows:
RSQ(known_y's, known_x's)
– known_y’s: This represents the dependent data points or the values that are affected.
– known_x’s: This signifies the independent data points or the values that influence the known_y’s.
Examples
Here are three examples to illustrate how to use the RSQ function:
Example 1: Basic Calculation
Suppose you have data for sales (Y) based on advertising spend (X):
=RSQ(B2:B6, A2:A6)
Where cells B2:B6 contain advertising spend and A2:A6 contain sales figures. This formula will return the R-squared value for these datasets.

Example 2: Comparing Multiple Datasets
Consider another scenario with two different products. You may want to evaluate their sales performance against pricing strategies. Assuming Product A’s sales figures are in C2:C6 and pricing in D2:D6, the RSQ function can be utilized as follows:
=RSQ(C2:C6, D2:D6)
Example 3: Analyzing Trends Over Time
If you have a time series data set where E2:E6 represents years and F2:F6 represents profits, the function can be used to evaluate the relationship between these variables:
=RSQ(F2:F6, E2:E6)
Error Handling
When using the RSQ function, certain errors can arise:
– NUM!: This error indicates that the lengths of the arrays for known_y’s and known_x’s do not match. Ensure that both arrays have the same number of data points.
– VALUE!: This error occurs if any of the provided arguments are non-numeric. Check the input data to confirm that all values are numbers.
Conclusion
The RSQ function in Excel is an essential analytical tool for statisticians and business analysts, allowing them to understand the relationship between variables quantitatively. By offering a straightforward method to compute the R-squared statistic, users can assess the effectiveness of linear models in their data analysis tasks. Mastering this function can significantly enhance predictive modeling and data interpretation capabilities.