How to Add a Trendline in Excel: The Complete 2026 Guide to Line of Best Fit, Regression, and Forecasting

Learn how to add line of best fit Excel charts use, plus trendline types, R-squared values, equations, and forecasting tips for 2026.

Microsoft ExcelBy Katherine LeeMay 24, 202618 min read
How to Add a Trendline in Excel: The Complete 2026 Guide to Line of Best Fit, Regression, and Forecasting

Learning how to add line of best fit excel users rely on every day is one of the most practical chart skills you can build, because a trendline turns a scattered cloud of data points into a clear story about direction, momentum, and likely future values. Whether you analyze sales pipelines, lab readings, marketing performance, or financial forecasts, mastering trendlines lets you communicate insight with a single line rather than a paragraph of numbers. This 2026 guide walks through every option Excel offers, from linear regression to exponential decay, with the click paths and equation logic you need.

Excel supports six built-in trendline types: linear, logarithmic, polynomial, power, exponential, and moving average. Each one answers a different analytical question, and choosing the wrong type is the most common mistake new analysts make. A linear trendline assumes a constant rate of change, while a polynomial trendline curves to follow rises and falls in seasonal data. Picking the model that matches your underlying process gives you a higher R-squared value and forecasts you can defend in meetings.

Before you add a trendline, your data must live in a scatter chart, line chart, bar chart, column chart, or area chart. Pie charts, doughnut charts, and 3D charts do not support trendlines because they cannot express a continuous independent variable on the horizontal axis. If you build a chart and the Trendline option is grayed out, that almost always means you selected an incompatible chart type. Convert to a scatter or 2D line chart and the option becomes available immediately.

The fastest method to add a trendline takes three clicks: select your chart, click the plus icon that appears to the right, and tick the Trendline box. Excel inserts a linear trendline by default. To switch types, hover over Trendline, click the arrow, and choose Linear, Exponential, Linear Forecast, or Two Period Moving Average. For complete control, click More Options to open the Format Trendline pane on the right side of the worksheet, where every parameter lives.

A line of best fit is more than a visual decoration. When you display the equation and R-squared value on the chart, you give readers two anchors: a mathematical formula they can use to predict new values, and a fit statistic that tells them how trustworthy that formula is. An R-squared of 0.95 means the trendline explains 95 percent of variation in your data, while 0.30 means most of the movement comes from factors your model is not capturing. Always show both numbers.

Forecasting forward is where trendlines pay for themselves. In the Format Trendline pane, the Forecast section lets you project the line forward or backward by any number of periods. A retail manager modeling six weeks of weekly revenue can forecast four weeks ahead, while a research team studying ten years of climate readings might project two decades. Excel extrapolates using the same equation that fits your historical data, so the quality of the forecast depends entirely on the quality of the fit.

This guide covers chart preparation, every trendline type with concrete use cases, the math behind R-squared, how to read and reuse trendline equations, common pitfalls like overfitting with high-order polynomials, mobile and web limitations, and the keyboard shortcuts that speed up workflow. By the end, you will know not only how to add a trendline but also when each type is appropriate, how to validate it, and how to communicate the result without overstating what the data shows.

Excel Trendlines by the Numbers

📊6Trendline TypesLinear, log, poly, power, exp, MA
🎯0.95+Good R-SquaredStrong predictive fit
⏱️3Clicks to AddChart, plus icon, trendline
🔢6Polynomial OrdersOrder 2 through order 6
📅Forecast PeriodsNo hard upper limit
Microsoft Excel - Microsoft Excel certification study resource

Step by Step Workflow to Add Any Trendline

📋

Prepare Two Column Data

Arrange your independent variable in the left column and dependent variable in the right column. Make sure both columns have headers, no blank rows interrupt the series, and numeric values use a consistent format like dates or integers throughout the range.
📈

Insert a Scatter or Line Chart

Select your data range, go to the Insert tab, and choose Scatter for continuous relationships or Line for time series. Avoid pie, doughnut, or 3D charts because they do not support trendline overlays at any version of Excel.

Click the Chart Plus Icon

Click anywhere on the chart to activate it, then click the small plus icon that appears at the upper right corner. This opens the Chart Elements menu where you can toggle gridlines, data labels, error bars, and the trendline checkbox.

Tick Trendline and Choose Type

Hover over Trendline, click the right arrow, and pick from Linear, Exponential, Linear Forecast, Two Period Moving Average, or More Options. The default selection is Linear which works for most relationships with a constant rate of change.
🧮

Format and Display Equation

Click More Options to open the Format Trendline pane. Scroll down and tick Display Equation on chart plus Display R-squared value on chart so readers see both the formula and the fit statistic next to the trendline directly.
🔮

Add Forecast Periods

In the same pane find the Forecast section and enter the number of periods to extend the line forward or backward. Excel extrapolates using the fitted equation so the projected segment follows the same mathematical curve as historical data.

Choosing the right trendline type matters far more than the click path that gets you there. Each of Excel's six options solves a different shape of relationship, and applying the wrong one produces a line that looks confident on screen but predicts poorly off-screen. The linear trendline is the workhorse: it assumes constant change per unit of x and works for revenue growing at a steady percentage, costs scaling with headcount, or any process where doubling the input roughly doubles the output. Use it as your first attempt.

The logarithmic trendline fits data that rises or falls quickly then levels off, like user engagement during a product launch or learning curves in skill acquisition. The curve is steep early and flat late, so it captures diminishing returns elegantly. Logarithmic trendlines require all x values to be positive because the natural logarithm of zero or a negative number is undefined. If your independent variable includes zeros, shift everything by one unit before fitting, then subtract one when interpreting predictions.

Polynomial trendlines bend to follow rises and falls in the data and accept an order from two to six. Order two creates one bend, order three creates two bends, and so on. Polynomials are powerful for seasonal patterns and lab measurements with known curvature, but high orders overfit ruthlessly. A sixth-order polynomial through twelve data points will pass through nearly every observation with a fake R-squared close to one, then explode wildly outside the visible range. Stop at order three unless you have strong physical reasoning.

Power trendlines model relationships where both variables grow at related rates, common in physics, biology, and economics scaling laws. The equation takes the form y equals a times x to the b, and you need positive values for both axes. Examples include allometric scaling between body mass and metabolism, or the relationship between advertising spend and brand awareness in some markets. Power trendlines often beat linear when log-log plots of your data form a straight line, which is a useful diagnostic to run first.

Exponential trendlines describe processes that grow or decay at a rate proportional to their current size: compound interest, radioactive decay, viral spread in early stages, or capacitor discharge. The equation is y equals a times e raised to bx. Like power and logarithmic models, exponential requires positive y values. If your data shows rapid acceleration that the linear fit cannot capture, the exponential trendline usually delivers a much higher R-squared and forecasts that respect the underlying compounding dynamic of the process.

The moving average trendline is conceptually different from the others. Instead of fitting an equation, it smooths the data by averaging a rolling window of points, defaulting to two periods. Use moving averages to reveal patterns in noisy time series, like daily website traffic or stock prices, where short-term volatility hides the underlying trend. Moving averages cannot be extrapolated forward into a forecast and they do not produce an equation or R-squared, so they are descriptive rather than predictive tools.

A practical workflow is to fit linear first, check the R-squared, then try logarithmic, exponential, or polynomial order two if linear performs poorly. Compare R-squared values across types but also inspect the residuals visually: a good fit shows points scattered randomly above and below the line, while a bad fit shows systematic curvature the trendline is missing. Pick the simplest model that captures the pattern.

FREE Excel Basic and Advance Questions and Answers

Practice trendline, chart, and core Excel skills with timed multiple choice questions and instant scoring.

FREE Excel Formulas Questions and Answers

Test your knowledge of SLOPE, INTERCEPT, LINEST, FORECAST, and TREND formulas used behind trendlines.

Trendline Equations and R-Squared for VLOOKUP Excel Users

The trendline equation Excel displays uses x as your independent variable and y as your dependent variable. A linear result like y equals 2.4x plus 18 means every one unit increase in x raises y by 2.4 units, and when x equals zero the predicted y is 18. Plug any future x value into the equation to compute a prediction without rebuilding the chart.

For exponential, power, and polynomial trendlines the equation is more complex but follows the same logic. Copy the displayed equation into a worksheet cell, replace x with a cell reference, and you have a reusable forecast formula that updates whenever new data lands. This is the same principle that vlookup excel workflows use to retrieve values dynamically from tables.

Excellence Playa Mujeres - Microsoft Excel certification study resource

Should You Use a Built-In Trendline or LINEST Formula?

Pros
  • +Built-in trendlines take three clicks with no formula knowledge required
  • +Equations and R-squared display directly on the chart for instant reader context
  • +Forecast periods extend the line visually without rebuilding the chart
  • +Six trendline types cover most common business and scientific relationships
  • +Format options control color, weight, and dash style for presentation polish
  • +Updates automatically when underlying data range changes
  • +Works identically in Excel desktop, Microsoft 365, and recent web versions
Cons
  • Cannot be used in pie, doughnut, radar, or 3D chart types at all
  • Polynomial order is capped at six which limits some advanced curve fits
  • Moving averages cannot be extrapolated forward as predictions
  • Equation display can show too few decimal places for precise reuse
  • No built-in confidence interval or prediction interval visualization
  • Logarithmic, power, and exponential require positive values only
  • Mobile Excel apps offer reduced trendline formatting options

FREE Excel Functions Questions and Answers

Drill SLOPE, INTERCEPT, LINEST, FORECAST, TREND, and GROWTH functions used by trendlines daily.

FREE Excel MCQ Questions and Answers

Multiple choice questions covering charts, trendlines, formulas, and core spreadsheet concepts.

Pre-Flight Checklist Before Adding Your Trendline

  • Confirm your chart type is scatter, line, bar, column, or area, not pie or 3D
  • Verify both columns contain only numeric or date values with no text mixed in
  • Remove or interpolate any blank cells inside the data range before charting
  • Sort the independent variable in ascending order for cleaner visual results
  • Decide whether your relationship is linear, logarithmic, exponential, power, or polynomial
  • Check that x values are positive if you plan to use logarithmic or power fits
  • Confirm y values are positive if you plan to use exponential or power fits
  • Open Format Trendline pane and tick both Display Equation and Display R-squared
  • Set forecast forward periods only as far as your data scope reasonably supports
  • Inspect residuals visually for systematic curvature your trendline might be missing

Right-click the data series before adding the trendline

Right-clicking the actual data series in the chart and selecting Add Trendline opens the Format Trendline pane immediately with every option visible. This skips the plus icon menu and gives you full control on the first click, saving roughly 40 percent of the time compared with the default workflow when adding multiple trendlines across different series.

Forecasting forward is where trendlines stop being decorative and start delivering business value. Open the Format Trendline pane, scroll to the Forecast section, and enter a positive number in the Forward field to extend the line into future periods. A retail planner with 26 weeks of historical sales might forecast four weeks ahead to support a purchasing decision, while a researcher with five years of monthly readings could project six months forward to flag where capacity bottlenecks might appear.

Backward forecasting is equally useful. Entering a number in the Backward field extends the line into the past, helping you estimate what values might have looked like before your earliest measurement. This is invaluable when joining two datasets that start at different dates, or when you want to confirm that the fitted equation makes physical sense at the origin. A trendline that predicts negative revenue at month zero is telling you the linear assumption breaks down at low volumes.

Excel offers three formula functions that complement chart-based forecasting and let you generate predictions in cells without rebuilding the chart. FORECAST.LINEAR takes a new x value, an array of known y values, and an array of known x values, then returns the predicted y on the line of best fit. TREND extends this to multiple new x values at once, returning an array. GROWTH performs the same operation for exponential rather than linear relationships, useful when your data compounds.

Set Intercept is a powerful but underused option in the Format Trendline pane. Tick the box and enter a value to force the trendline through a specific y-intercept, most commonly zero. This is appropriate when physics or business logic dictates the relationship must pass through the origin: zero advertising spend yields zero attributable revenue, zero hours worked yields zero output, zero substrate yields zero product. Forcing the intercept usually lowers R-squared slightly but produces equations that make sense outside the observed range.

Display Equation and Display R-squared value on chart are the two most important checkboxes in the entire pane. The equation lets readers reuse your formula independently, while R-squared lets them judge how much trust to place in any single prediction. Without both numbers visible, a trendline is just a line. Format the equation with at least four significant digits by right-clicking the displayed equation, choosing Format Trendline Label, and switching the number format to scientific or custom with extra decimal places.

Period validation is critical when forecasting. A trendline fitted to two years of monthly data can credibly project six months forward, but projecting five years forward extrapolates well beyond the observed range and amplifies any model misspecification. As a rule of thumb, do not forecast more than 20 percent of the length of your training data unless you have strong external reasoning. For 100 data points that means roughly 20 periods ahead, after which prediction intervals widen rapidly.

Combining trendlines with other Excel analytical tools multiplies their power. Use a trendline to identify the underlying pattern, then apply Data Analysis ToolPak regression for confidence intervals and significance tests the chart cannot show. Pair with conditional formatting on the residuals to highlight where the model fits poorly. Stack multiple trendlines on the same chart by adding one per data series, useful for comparing growth rates across products, regions, or time cohorts in a single visual.

Excel Spreadsheet - Microsoft Excel certification study resource

The single most common trendline mistake is choosing the wrong type and ignoring R-squared. Analysts often default to linear because it is the first option, even when the data clearly curves. Always look at the shape of your scatter plot before adding the line: data that bends upward exponentially needs an exponential trendline, data that levels off needs logarithmic, and data with one pronounced peak or valley needs polynomial order two. Picking the wrong family produces a confident-looking line that predicts poorly outside the observed range.

Forcing a trendline on data that has no real relationship is the second classic error. If your scatter plot looks like a random cloud of points with no visible direction, R-squared will be near zero no matter which type you choose. Excel still draws the line because you asked for it, but the equation is meaningless. Always inspect the raw scatter plot first and ask whether a relationship is visually plausible before fitting any model.

Forecasting too far into the future is the third trap. A trendline fitted to twelve months of data can support a forecast of two or three months. Forecasting twelve months forward doubles your data scope and assumes the underlying process is perfectly stationary, which it almost never is in business contexts. Customers churn, competitors enter, regulations change, and external shocks like recessions or pandemics invalidate any model based purely on historical pattern matching.

Ignoring zero or negative values when using logarithmic, power, or exponential trendlines causes silent errors. Excel will sometimes fit the model anyway by ignoring the offending rows, leaving you with a fit that secretly excludes some of your data. Always check that the number of points the trendline uses matches the number of points in your series. If they differ, switch to a model that accepts all your values or transform your data so it meets the model assumptions.

Confusing correlation with causation is a conceptual rather than technical mistake but the most damaging one in reporting. A trendline shows that two variables move together within your sample. It does not prove that changing the independent variable will cause the dependent variable to change. Ice cream sales and drowning deaths both rise in summer; a trendline between them looks great but ice cream does not cause drowning. Hot weather causes both, and missing that confounder leads to bad decisions.

Failing to update the trendline as new data arrives is a maintenance failure that creeps into dashboards over time. When you extend the source range with fresh rows, Excel usually recalculates the trendline automatically, but only if the chart data range was defined to include the new cells. Always confirm by clicking the chart, checking the highlighted source range in the worksheet, and adjusting if the new data points fall outside the included rows of the original selection.

Finally, never present a trendline without context. Display the equation, R-squared, the time period it covers, the trendline type chosen, and any known events that might break the pattern. A trendline is a model, models are approximations, and the readers of your chart deserve to know how the approximation was built before they make decisions worth thousands or millions of dollars based on a single extrapolated line drawn through a spreadsheet.

Practical mastery of trendlines comes from repetition with real datasets across different chart types. Start by recreating familiar business reports with trendlines added: monthly revenue with a linear forecast, customer acquisition cost over quarters with a polynomial fit, or website traffic with a moving average to smooth daily noise. Each exercise builds intuition for which type matches which pattern, and over a few weeks you will pick the right model on first attempt without checking R-squared comparisons.

Keyboard shortcuts speed up the workflow significantly once you commit to using trendlines daily. Alt plus F1 inserts a default chart from selected data instantly, while Ctrl plus 1 opens the Format pane for whichever element you have selected, including the trendline itself. Right arrow and left arrow cycle through chart elements without clicking, and Tab cycles through data series. Combining these shortcuts means you can go from raw numbers to fitted forecast in under thirty seconds with practice.

For collaborative work, document your trendline choices in the chart title or a nearby cell. Write Linear fit, R-squared 0.87, January 2024 through April 2026, six week forward forecast as a one-line caption beneath the chart. Future readers, including your future self, will understand the model assumptions immediately and avoid misinterpreting the projection. This habit transforms charts from disposable visuals into reusable analytical artifacts that survive team handoffs and audit reviews.

Validation against held-out data is the professional standard for any trendline you intend to act on. Split your historical data into a training portion, typically 80 percent of the records, and a testing portion, the remaining 20 percent. Fit the trendline only on the training data, then compare the model's predictions on the testing data against actual values. If the predictions are accurate, the model generalizes. If they are wildly off, the model overfits and you need a simpler form.

Combining trendlines with what-if analysis amplifies their decision-making power. Use Data Tables or Scenario Manager to vary one input across a range and see how the projected y value changes across the trendline equation. This converts a static forecast into a sensitivity analysis that answers questions like what happens to projected revenue if growth slows by ten percent. Decision makers respond more strongly to ranges than to point estimates, and trendlines make both easy to generate.

When sharing charts with non-technical stakeholders, hide the equation if it adds clutter but keep R-squared visible as a quality indicator. Replace the raw equation with a plain English summary in a text box: Sales are growing at approximately $2,400 per month with 92 percent confidence in the trend. This translation step bridges the gap between analyst output and executive consumption, ensuring that the insight rather than the math becomes the focus of any meeting where the chart appears on screen.

Finally, schedule periodic reviews of any trendline embedded in a recurring dashboard. Models that fit well in January may drift by July as the underlying business changes. Set a calendar reminder to re-fit and re-evaluate every quarter, compare new R-squared against the original, and switch trendline type if the data pattern has evolved. Treating trendlines as living models rather than one-time decorations is what separates analysts who deliver durable value from those whose reports go stale.

FREE Excel Questions and Answers

Comprehensive Excel certification practice test covering charts, formulas, functions, and analytical features.

FREE Excel Trivia Questions and Answers

Fun trivia format covering Excel history, hidden features, charts, trendlines, and lesser known shortcuts.

Excel Questions and Answers

About the Author

Katherine LeeMBA, CPA, PHR, PMP

Business Consultant & Professional Certification Advisor

Wharton School, University of Pennsylvania

Katherine Lee earned her MBA from the Wharton School at the University of Pennsylvania and holds CPA, PHR, and PMP certifications. With a background spanning corporate finance, human resources, and project management, she has coached professionals preparing for CPA, CMA, PHR/SPHR, PMP, and financial services licensing exams.