Scatter Plot Equation in Excel: Find, Read, and Use It

How-to basics · Updated November 21, 2026

To find a scatter plot equation in Excel for Microsoft 365 on Windows, select the chart, then choose Chart Design > Add Chart Element > Trendline > Linear. Select the trendline, open More Trendline Options, and check Display Equation on chart. Excel displays a fitted line equation, usually in the form y = mx + b; the slope and intercept describe the relationship between the plotted X and Y values.

What a scatter plot equation tells you

A scatter plot places paired numeric values on two axes: one variable supplies each point’s X coordinate and the other supplies its Y coordinate. A trendline summarizes the pattern in those points. For a linear trendline, the equation y = mx + b describes a straight line: m is the slope, and b is the Y-intercept. In an Excel chart, x refers to the horizontal-axis value and y to the vertical-axis value.

For example, if a chart shows y = 2x + 1, the line predicts a Y value of 5 when X is 2. Its slope of 2 means the predicted Y value increases by 2 for each one-unit increase in X. The intercept of 1 is the line’s predicted Y value where X equals zero. That intercept may be outside the range of your observations, so it is not always a meaningful real-world measurement.

The equation belongs to the trendline, not to the scatter chart as a whole. It is a model based on the selected data series. It can help describe an association or make estimates, but it does not by itself show that changes in X cause changes in Y.

Prepare the data for an XY scatter chart

Put the numeric X values in one column and the corresponding numeric Y values in a neighboring column. Keep each pair on the same row, and use a clear heading above each column. For example, a small data set might look like this:

  • Column A heading: X; cells A2:A5: 1, 2, 3, 4.
  • Column B heading: Y; cells B2:B5: 3, 5, 7, 9.

Select both columns, including headings, then choose Insert > Insert Scatter (X, Y) or Bubble Chart and select a scatter option with markers. A basic markers-only chart is often easiest to interpret when you want to fit a trendline. Excel uses the first selected numeric column for X and the next for Y in the usual two-column layout, but check the plotted axes if your selection is unusual.

A scatter chart is appropriate when both variables are numeric and the horizontal position represents a measured X value. It is different from a line chart, which commonly treats horizontal-axis entries as categories spaced evenly apart. If your X values are dates or numbers with meaningful gaps, a scatter chart preserves those distances. Avoid including totals or unrelated numeric columns in the selection, since Excel may interpret them as additional series.

Add and display the trendline equation

  1. Click the chart, then click the data series whose relationship you want to model. If the chart has several series, make sure the intended points are selected.
  2. On the ribbon, choose Chart Design > Add Chart Element > Trendline > Linear. Excel adds a straight-line fit to that series.
  3. To show the equation, choose Chart Design > Add Chart Element > Trendline > More Trendline Options. In the Format Trendline pane, select Display Equation on chart. You can also select Display R-squared value on chart if you want that statistic shown.
  4. Move the equation label to an open area of the chart so it does not cover points. If needed, resize the chart or adjust the label’s number format to show more decimal places.

The equation and R-squared value are labels attached to the chart. They update when the underlying data changes, but they can be rounded for display. If you need precise coefficients for calculations, use worksheet functions or increase the displayed decimal places rather than copying a short rounded label.

Read the equation and check the example

With X values 1, 2, 3, 4 in A2:A5 and Y values 3, 5, 7, 9 in B2:B5, the points lie exactly on the line y = 2x + 1. The trendline’s slope is 2 and its intercept is 1. Substituting X = 4 gives 2 × 4 + 1 = 9, which matches the last observed Y value. Because every point lies on the line, the chart’s R-squared value is 1, or 100 percent.

In real data, points usually do not all fall exactly on a line. The fitted equation then describes the line that best represents the pattern under Excel’s trendline method; it is not a promise that every observation will equal the prediction. R-squared gives an indication of how closely the fitted line accounts for variation in the plotted Y values in this setting. A high value does not prove the model is appropriate, establish causation, or guarantee accurate predictions beyond the observed range.

Calculate slope, intercept, and predictions in cells

Worksheet formulas are useful when you want coefficients you can reuse, calculate predictions, or keep results separate from the chart label. For X values in A2:A5 and matching Y values in B2:B5, enter this formula in a blank cell to calculate the slope:

=SLOPE(B2:B5,A2:A5)

It returns 2 for the example. The order matters: SLOPE takes the known Y values first and the known X values second. For the same data layout, calculate the intercept with:

=INTERCEPT(B2:B5,A2:A5)

It returns 1. These results correspond to the chart’s linear equation y = 2x + 1, subject to any rounding in the chart label.

To predict Y for an X value stored in A2 using the observations in A2:A5 and B2:B5, enter the following formula in another cell:

=SLOPE($B$2:$B$5,$A$2:$A$5)*A2+INTERCEPT($B$2:$B$5,$A$2:$A$5)

For A2 equal to 1, this returns 3. The dollar signs keep the ranges fixed if you copy the formula down, while A2 changes to A3, A4, and so on. If you want to predict values for new X inputs, place those inputs in another column and point the formula’s final A2 reference to the appropriate input cell. A prediction outside the range of observed X values is extrapolation and can be much less reliable than an estimate within that range.

Choose a trendline that fits the pattern

A linear trendline is a sensible starting point when the points show an approximately straight pattern. It is not automatically the best choice just because the chart can display an equation. Excel offers other trendline types, including exponential, logarithmic, power, polynomial, and moving average. The shape and assumptions matter; for example, logarithmic and power trendlines have restrictions on the values they can fit, and an exponential model is not a general substitute for a straight line.

A polynomial trendline can describe a curved pattern, but increasing its order can make the curve follow individual fluctuations rather than a stable relationship. A moving average smooths fluctuations but is not the same kind of equation-based relationship as a linear fit. Compare candidate fits against the data and the question you are trying to answer, and do not select a complicated curve solely because its displayed R-squared value is higher. More complex models can fit the existing points closely while predicting new points poorly.

Common problems and how to fix them

  • The equation option is missing: Confirm that you selected a data series in a compatible chart and added a trendline. Use More Trendline Options to open the Format Trendline pane; the equation checkbox is there.
  • The equation has too few decimals: The chart label may round coefficients. Select or right-click the equation label and use Format Trendline Label to adjust its number format where available, or calculate coefficients with SLOPE and INTERCEPT.
  • The line looks wrong: Check that X and Y columns were assigned to the intended axes and that each row contains one matching pair. Confirm that the chart is an XY scatter chart rather than a category-based line chart.
  • Points are missing or misplaced: Check for text values, blank cells, accidental headers inside the data, or values stored as text. Also check whether a few extreme values are stretching the axes and making the main cluster look compressed.
  • The intercept seems strange: The intercept is the fitted value at X = 0. If zero is far outside the measured range, that value may have little practical meaning. Do not force a zero intercept unless the subject and model justify it.

On Excel for Mac, the chart tabs and pane layout can differ slightly, but the chart’s trendline options also provide a setting to display the equation. Excel for the web may have a more limited or different chart-editing interface depending on the current feature set; if the trendline option is unavailable, open the workbook in the desktop application. Avoid relying on a menu name from an older Excel version if the ribbon labels differ.

How to use the equation responsibly

Before using a trendline equation, ask whether a straight-line relationship is plausible, whether the data cover the range where you intend to make estimates, and whether any outliers or data-entry errors dominate the fit. Label axes with units and give the chart a useful title. A slope has units of Y per unit of X, so the units help explain what the coefficient means. For instance, if X is time in months and Y is sales in dollars, the slope is dollars per month.

Use the chart as a visual check as well as a source of coefficients. A single equation can hide clusters, curved patterns, or a change in behavior across the range. If the data come from a small sample, measurement process, or changing conditions, predictions should be treated as estimates rather than certain outcomes. Keep the observed values visible and note whether a reported prediction is interpolation within the data range or extrapolation beyond it.

Frequently Asked Questions

What is the equation of a scatter plot in Excel?
A scatter plot itself does not have one equation. When you add a trendline, Excel can display the fitted relationship for a data series, such as y = mx + b for a linear trendline.

How do I show the R-squared value too?
Open Chart Design > Add Chart Element > Trendline > More Trendline Options, then select Display R-squared value on chart. Interpret it alongside the plotted points and the suitability of the model.

Can I get the equation without putting it on the chart?
Yes. For a linear relationship, use SLOPE and INTERCEPT with the known Y range first and the known X range second. Their results give the coefficients for the line without requiring a displayed chart label.

Why does my chart equation differ slightly from my cell calculation?
The chart label may display rounded coefficients, while worksheet calculations use the stored values at full precision. Increase the label’s displayed decimal places or use the worksheet coefficients for calculations.

Should I force the trendline through zero?
Only when a zero intercept is justified by the measurement and the model. Forcing the line through zero changes the fit; it should not be done merely to make the equation look simpler.

Can I use the equation to predict values?
Yes, as an estimate: substitute an X value into the fitted equation or use worksheet formulas. Predictions are generally more defensible within the observed X range, and the equation alone does not quantify all sources of uncertainty.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.