In Excel: click the chart, open the ➕ Chart Elements button and tick Trendline — then right-click the line ▸ Format Trendline to pick the type and show the equation and R².
On this page7
6 pairs
R² = 0.9962
Intercept = 0.1667
What this does
A trendline is a fitted line drawn through a data series: linear by default, with exponential, logarithmic, polynomial, power and moving-average alternatives in the Format Trendline pane. Two checkboxes at the bottom of that pane matter more than the line itself — "Display Equation on chart" and "Display R-squared value on chart". The equation lets you reproduce the fit in a formula, and R² tells you how much of the variation the line actually explains, which is the difference between a trend and a decoration. Excel also exposes the same maths as worksheet functions: SLOPE, INTERCEPT, RSQ, LINEST and TREND. Keep the inputs visible and clearly labelled and the whole thing stays auditable — anyone who opens the file later, including you, can see at a glance exactly what feeds the result and change one assumption without hunting through the formula. For “add a trendline in excel”, the reliable version is a short checking loop, not just the first command that appears to work. Run it on a deliberately small range first, watch how the affected cells change, and only then apply the same setup to the full sheet. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. That is what makes a visual that makes the number obvious at a glance useful in real work: repeatable, auditable, and not dependent on memory or luck.
A worked example
Twelve months of revenue in B2:B13 against month numbers in A2:A13. Click the chart ▸ ➕ ▸ Trendline ▸ Linear. Right-click the line ▸ Format Trendline ▸ tick Display Equation and Display R-squared. If the chart shows y = 3,120x + 41,500 and R² = 0.87, revenue is rising about €3,120 a month and the straight line explains 87% of the variation. The same numbers without a chart: =SLOPE(B2:B13,A2:A13) returns 3120, =RSQ(B2:B13,A2:A13) returns 0.87. A trendline turns a scatter of points into a stated rate of change, and the equation plus R² is what makes that statement defensible instead of a line someone drew through the noise. One habit worth forming early: name the cells that hold your inputs, so the formula reads in plain language instead of a string of cell addresses. A reviewer — or you in three months — can then follow the logic without decoding what B7 and D2 were supposed to mean, which is most of what makes a sheet maintainable.
In Google Sheets
If you are in Google Sheets rather than Excel, the good news is that the formula shown here is identical and the workflow barely changes — menus sit across the top instead of in a ribbon, and a few function names differ slightly, but anything you build here moves across with little or no rework. The aim was to get you unstuck fast and leave you a little more capable than a copy-paste would. The answer is at the top, the tool proves it, and the detail above shows why it holds — so the next time a colleague asks, you can answer without reaching for search. The short version of “add a trendline in excel”: the answer is at the top of this page, the tool proves it on your own numbers, and the sections above explain why it holds so the next variation does not stump you. Excel rewards people who reference cells instead of typing values and who keep inputs separate from formulas, because that is what makes a result you can audit months later. Build it once, deliberately, with the live tool as a check, and you convert a one-off lookup into a reusable skill — which is the whole point of learning the why and not just the what.
Common mistakes
- Fitting a high-order polynomial because it hugs the points — an order-6 fit through 12 points has almost no predictive value and a flattering R².
- Adding a trendline to a bar chart of categories, where the x-axis has no numeric meaning.
- Quoting the slope without R², which hides how well the line actually fits.
- Forecasting far beyond the data and presenting the extension as a measurement rather than an assumption.
- Leaving unequal time gaps in the x values while treating them as evenly spaced — use a scatter chart with real x values.
Frequently asked questions
How do I add a trendline in Excel?
Click the chart, press the ➕ Chart Elements button and tick Trendline. On Mac use Chart Design ▸ Add Chart Element ▸ Trendline.
How do I show the trendline equation?
Right-click the trendline, choose Format Trendline, and tick "Display Equation on chart" and "Display R-squared value on chart" at the bottom of the pane.
What does R-squared mean?
The share of the variation in your data that the fitted line explains, from 0 to 1. R² = 0.87 means 87%. A low R² means the line is drawn but the relationship is weak.
Can I get the trend without a chart?
Yes — =SLOPE(known_ys, known_xs) and =INTERCEPT(known_ys, known_xs) give the same line, =RSQ() gives R², and =TREND() returns fitted values for new x inputs.
Other ways people ask this
People reach this page typing “how to add trendline in excel”, “add trendline excel”, “how do i add a trendline in excel” and “add a trendline in excel”, among other phrasings; whichever wording you used, the fix above is the one you want.
Platform & version notes
- If you are on a Mac, nothing here changes except the modifier key: swap Ctrl for ⌘ in every shortcut, and use the Windows/Mac toggle at the top of the page so the keystrokes shown match the keyboard in front of you.
How is it different on a Mac?
Only the keys. Press ⌘ where Windows uses Ctrl; the menus, formulas and result for "add a trendline in excel" are the same on macOS as on Windows.
Why do people search for this in so many different ways?
Because the same task has many names. “how to add trendline in excel”, “add trendline excel”, “how do i add a trendline in excel” all point at the one operation explained on this page, which is why they all lead here.