Displaying the R squared value in Excel is quick: add a trendline to your chart and tick the option to show the R-squared value on the chart, or use the RSQ function in a cell. R squared (the coefficient of determination) tells you how well your data fits a trend — a value close to 1 means a strong fit. There are two reliable ways to get it, and both take under a minute once your data is in place.

What You'll Need

  • A spreadsheet with paired data in two columns (for example, X values in column A and Y values in column B)
  • Excel on desktop (Windows or Mac) — the chart trendline method also works in Excel for the web, though chart menus can look slightly different

Step-by-Step

Method names and menu labels can differ slightly between Excel versions and platforms, but the steps below cover the standard current versions.

Method 1: Show R squared on a chart trendline

  1. Select your two columns of data, including the headers if you have them.
  2. Go to the Insert tab and choose a scatter chart — click Insert Scatter (X, Y) and pick the plain Scatter option. A scatter chart is the right choice for X/Y paired data.
  3. Click any data point on the chart to select the series, then right-click it and choose Add Trendline from the menu.
  4. The Format Trendline pane opens on the right. Under Trendline Options, pick the type that fits your data — Linear is the most common.
  5. Scroll down and tick the checkbox labelled Display R-squared value on chart. You can also tick Display Equation on chart if you want the trendline equation shown alongside it.
  6. The R squared value appears as a small label on the chart (for example, "R² = 0.94"). Click it and drag it if it overlaps your data points. Close the Format Trendline pane when you're done.

Method 2: Use the RSQ function in a cell

  1. Click an empty cell where you want the result.
  2. Type =RSQ(known_ys, known_xs), replacing the arguments with your ranges. For example, if your Y values are in B2:B21 and X values in A2:A21, type =RSQ(B2:B21, A2:A21). Note the order: Y range first, then X range.
  3. Press Enter. The cell shows the R squared value as a decimal, such as 0.9413.
  4. To show more decimal places, select the cell and use the Increase Decimal button on the Home tab.

Bonus: get R squared with a full regression summary

  1. Go to the Data tab and click Data Analysis. If you don't see it, the Analysis ToolPak add-in needs to be enabled (see Troubleshooting below).
  2. Choose Regression and click OK.
  3. Set the Input Y Range and Input X Range, tick Labels if your ranges include headers, and click OK.
  4. In the output table, look for R Square in the Regression Statistics section. This method also gives you adjusted R square, which is useful when you have multiple X variables.

Common Mistakes

  • Using a line chart instead of a scatter chart. Line charts space points evenly by category and can give a misleading trendline. For numeric X/Y data, always use a scatter chart.
  • Swapping the RSQ arguments. RSQ takes the Y range first, then the X range. Reversing them still returns a value, which can quietly be wrong.
  • Leaving blank cells or text in the data ranges. RSQ returns a #DIV/0! error or ignores rows unpredictably if the ranges contain non-numeric entries.
  • Assuming a high R squared means causation. It only measures how well the line fits the data, not whether one variable causes the other.
  • Comparing R squared across different trendline types carelessly. A polynomial trendline will almost always fit better than a linear one on the same data — that doesn't mean it's the better model.

Tips

  • To update the R squared label after adding new data, first extend the chart's data range (drag the coloured range outlines on the worksheet, or right-click the chart and use Select Data); the trendline and its R² label update automatically.
  • The chart label and the RSQ function give the same result for linear fits — use whichever is more convenient for your report.
  • Use Adjust R square from the Data Analysis regression output when you have several X variables, as it accounts for the number of predictors.
  • To change the trendline type later, double-click the trendline to reopen the Format Trendline pane and pick a different option; the R² value recalculates instantly.
  • If you're documenting your work, the RSQ cell method is easier to reference in formulas and tables than a chart label.

Troubleshooting

  • No "Display R-squared value" checkbox appears: this option is unavailable for moving average trendlines. Switch the trendline type to Linear, Exponential, Logarithmic or another standard type and the checkbox will appear.
  • Data Analysis button is missing from the Data tab: enable the Analysis ToolPak. Go to File > Options > Add-ins (on Mac, Tools > Excel Add-ins), select Excel Add-ins in the Manage box, click Go, tick Analysis ToolPak and click OK. The Data Analysis button then appears on the Data tab.
  • RSQ returns #DIV/0!: your X values may all be identical (a vertical line has no fit), or one of the ranges is empty. Check that both ranges contain numbers and your X values actually vary.
  • RSQ returns #N/A: the two ranges are different lengths. Make sure known_ys and known_xs cover the same number of rows.
  • R squared label vanished from the chart: you may have deleted the label accidentally. Double-click the trendline to open Format Trendline and tick Display R-squared value on chart again.
  • Chart trendline is greyed out: you're probably on a 3-D chart or a chart type that doesn't support trendlines (such as a pie or doughnut chart). Change the chart to a scatter or 2-D line chart first.
  • Numbers look wrong in Excel for the web: the web version's chart pane is simplified but the trendline and R² options are there — select the chart, click the chart elements (plus) button, then Trendline, then More Options.

Frequently Asked Questions

What does the R squared value actually mean?

It's the proportion of the variation in your Y values explained by the trendline. An R² of 0.9 means the line explains about 90% of the variation. Closer to 1 is a better fit; near 0 means the line explains very little.

Is the RSQ function the same as the R² on a chart trendline?

Yes, for a linear trendline on a scatter chart they match. RSQ always calculates the linear fit's R squared, while the chart label reflects whatever trendline type you've selected, so they can differ for polynomial or exponential trendlines.

Can I show R squared on a bar chart?

Trendlines can be added to some 2-D bar and line charts in Excel, and the R² option works the same way. For true numeric X/Y data, a scatter chart is still the correct and more accurate choice.

How many decimal places should I display?

There's no fixed rule — two to four decimal places is typical for reports. For the chart label, Excel chooses the formatting automatically; for the RSQ cell, use the Increase Decimal button on the Home tab.

What's the difference between R squared and adjusted R squared?

Adjusted R squared corrects for the number of predictors in the model, so it only rises if a new variable genuinely improves the fit. Excel shows it in the Data Analysis regression output. For a simple one-variable trendline, plain R squared is fine.