To find the R-squared (R²) value in Excel, you can use the RSQ function or add a trendline to a scatter plot. R² measures how well your data fits a linear model, ranging from 0 (no correlation) to 1 (perfect fit). You need two columns of numerical data: one for the independent variable (X) and one for the dependent variable (Y). No add-ins or special tools are required—this works in all modern versions of Excel.

What You'll Need

  • A worksheet with at least two columns of numerical data (X and Y values)
  • Excel 2007 or later (functions work identically across versions)
  • Ensure data contains no text, blank cells, or non-numeric entries in the columns you’re analyzing

Step-by-Step

  1. Open your Excel workbook and confirm your data is arranged in two adjacent columns. For example, Column A contains X-values (like time or temperature) and Column B contains Y-values (like sales or readings).
  2. Select an empty cell where you want the R² value to appear. This can be anywhere on the sheet, but place it near your data for clarity.
  3. Type the formula: =RSQ(B2:B100,A2:A100). Replace B2:B100 with the range of your Y-values and A2:A100 with the range of your X-values. Adjust the row numbers to match your actual data range—do not include headers.
  4. Press Enter. Excel will calculate and display the R-squared value as a decimal between 0 and 1.
  5. For visual confirmation, highlight both data columns, then go to Insert > Charts > Scatter. Right-click any data point, select "Add Trendline," then check "Display R-squared value on chart." The R² value will appear on the chart near the trendline.
  6. To format the R² value as a percentage for easier interpretation, select the cell with the result, right-click, choose "Format Cells," then select "Percentage" and specify 1 or 2 decimal places.

Common Mistakes

  • Using text or blank cells in data ranges: The RSQ function returns #DIV/0! if any cell in the range is non-numeric. Clean your data first.
  • Including headers in the formula range: If you include row 1 (e.g., A1:A100) and it contains column titles like "Temperature," Excel treats it as text and breaks the calculation.
  • Mixing data types: If one column has dates formatted as text or currency symbols (like "$" or "%") in numeric cells, RSQ will fail.
  • Using the wrong order: RSQ requires Y-values first, then X-values. Reversing them gives incorrect or misleading results.
  • Expecting R² to confirm causation: R² only measures correlation strength, not whether one variable causes the other. A high R² doesn’t prove a causal relationship.

Tips

  • Use named ranges for clarity: Select your X and Y data, then go to Formulas > Define Name and assign names like "X_Data" and "Y_Data." Then use =RSQ(Y_Data,X_Data)—this makes formulas easier to read and reuse.
  • Apply conditional formatting to highlight R² values: If R² > 0.8, color the cell green to quickly identify strong correlations.
  • Compare multiple datasets: Place RSQ formulas side-by-side to rank different models (e.g., sales vs. ad spend vs. temperature).
  • Combine with CORREL: Use =CORREL(A2:A100,B2:B100) to get the correlation coefficient (r). Square it manually to verify it matches your RSQ result—this is a good validation step.
  • Always visualize: Even if RSQ gives a high number, plot the data. Outliers or nonlinear trends can distort R². A scatter plot reveals patterns numbers alone can’t.

Troubleshooting

  • Formula returns #VALUE!: One or more cells contain text. Use Filter to find non-numeric entries. Select the data range, go to Data > Filter, then click the dropdown arrow on each column and uncheck "Text Filters" to isolate text.
  • Formula returns #DIV/0!: This means either all X-values are the same, or all Y-values are the same. Check for constant data. If every X value is 5, there’s no variation to correlate with Y.
  • Chart trendline shows different R² than RSQ: Double-check the data ranges. The chart may be using a different subset of data than your formula. Ensure both use identical ranges and that no rows are hidden.
  • RSQ works but correlation seems off: Verify your data is linear. RSQ assumes a straight-line relationship. If your curve is exponential or logarithmic, R² will be misleading—use logarithmic or polynomial trendlines instead.
  • Formula doesn’t update when data changes: Ensure Excel is set to Automatic Calculation. Go to Formulas > Calculation Options and confirm "Automatic" is selected.

Frequently Asked Questions

Can I use R-squared for non-linear data?

No. RSQ calculates linear correlation only. For curved relationships, use polynomial regression or transform your data first. The R² from a linear trendline on curved data is misleading.

Does R² tell me if my model is good?

Not alone. A high R² (like 0.95) might look strong, but if your sample size is small or outliers exist, it may not be reliable. Always consider context, sample size, and residual plots.

Why is my R² value so low even though the trendline looks straight?

Low R² often means high variability. Even if the line looks linear, if data points are widely scattered, the correlation is weak. Check for measurement error, missing variables, or external influences.

Can I calculate R² with more than two variables?

No. RSQ only works with two variables. For multiple predictors, use the Data Analysis ToolPak’s Regression tool (if enabled), which provides adjusted R².

What’s the difference between R² and correlation coefficient?

Correlation (r) measures direction and strength of linear association (from -1 to 1). R² is r squared, so it always ranges from 0 to 1 and represents the proportion of variance explained. For example, r = 0.7 means R² = 0.49.

Does Excel’s RSQ function handle missing data?

No. If any cell in the range is blank or text, the function ignores the entire pair. If you have gaps, delete those rows or replace blanks with appropriate values before using RSQ.