You can show the formula that created your chart's trendline directly on the graph itself
Excel lets you add a trendline equation to any chart — a line that shows the mathematical relationship between your data points. Once you add the trendline, you can check a box to display its equation right on the chart. This is useful when you want to see the exact formula, predict future values, or show someone else how your data behaves mathematically.
The equation appears as text on the chart itself, not in a cell. You can move it around, resize it, and format it like any other chart element. The process takes about 30 seconds once you have a chart built.
Key Takeaways
- You must have a trendline on your chart before you can display its equation — a trendline is a line that shows the trend in your data.
- Right-click the trendline itself (not the data points), then check the box labeled "Display Equation on chart" in the Format Trendline window.
- The equation appears as text you can click, drag, and reposition anywhere on the chart.
- Different trendline types (linear, polynomial, exponential) produce different equations, so choose the type that matches your data pattern.
Adding a trendline to your chart first
Before you can display an equation, you need a trendline. Click anywhere on your chart to select it, then right-click on one of your data points (the dots or bars representing your numbers). A menu appears. Select "Add Trendline" from the bottom of that menu.
A panel opens on the right side of your screen labeled "Format Trendline". Under "Trendline Options", you will see several choices: Linear, Exponential, Power, Polynomial, and Moving Average. Linear is the most common — it draws a straight line through your data. Leave it set to Linear unless your data clearly curves upward or downward, in which case Polynomial often works better. Click "Close" or click elsewhere on the chart when you are done. A line now appears on your chart showing the trend.
Displaying the equation on the chart
Now right-click directly on the trendline itself — the line you just added, not the data points. A small menu appears. Click "Format Trendline" at the bottom. The Format Trendline panel opens again on the right.
Scroll down in that panel until you see a checkbox labeled "Display Equation on chart". Check that box. The equation when ready appears somewhere on your chart, usually in the upper left or upper right corner. It looks like y = 2.5x + 10 or similar, depending on your data. You can now close the Format Trendline panel.
Moving and formatting the equation text
Click on the equation text to select it. Small handles appear around it. You can now drag it to any position on the chart — move it to a blank area where it does not cover your data. You can also resize it by dragging the corner handles, though this is rarely necessary.
To change how the equation looks, right-click on it and select "Format Text Box". From here you can change the font size, color, or background. Most people leave it as is. If you want to remove the equation later, just click it and press Delete.
Understanding what the equation means
A linear equation like y = 2.5x + 10 means: for every one unit increase in x (your horizontal axis), y (your vertical axis) increases by 2.5 units. The number at the end (10) is where the line crosses the y-axis. You can use this equation to predict values that are not on your chart — if x is 20, then y would be (2.5 × 20) + 10 = 60.
A polynomial equation looks more complex, like y = 0.5x² + 2x + 5, and curves rather than staying straight. The R² value that sometimes appears next to the equation (like R² = 0.92) tells you how well the trendline fits your actual data — closer to 1.0 means a better fit. You do not need to understand the math deeply; the equation is mainly there so you can see the pattern and share it with others.
Choosing the right trendline type for your data
Linear trendlines work best when your data points form a roughly straight pattern — sales growing at a steady rate, or temperature dropping consistently. If your data curves upward or downward noticeably, try Polynomial instead. Exponential works when something grows faster and faster (like bacteria multiplying). Power works when one thing depends on another in a specific mathematical way.
The easiest approach: start with Linear. If the line does not seem to follow your data closely, right-click the trendline again, open Format Trendline, and try Polynomial. Most business data works with one of these two. Do not overthink it — the equation will display no matter which type you choose.
Showing both the equation and the R² value
When you right-click the trendline and open Format Trendline, you can check a second box below "Display Equation on chart" that says "Display R-squared value on chart". This adds a number like R² = 0.87 next to your equation. This number tells you how closely the trendline matches your actual data points — 1.0 is a perfect match, 0.5 is a weak match.
Most people only add the R² value if they are presenting data to someone technical or if they want to compare which trendline type fits best. For everyday business charts, the equation alone is usually enough. Both the equation and the R² value update automatically if you change your data or switch to a different trendline type.
Frequently Asked Questions
Can I add an equation to a chart without a trendline?
No. The equation comes from the trendline itself — it is the mathematical description of that line. You must add a trendline first. If you do not want a visible line on your chart but still want the equation, add the trendline, display the equation, then right-click the trendline and select "Delete" to remove just the line while keeping the equation text.
Why does my equation have different numbers than I expected?
Excel calculates the trendline based on all your data points, not just the highest and lowest. If your data is scattered, the equation represents the best-fit line through that scatter, not a line connecting specific points. This is correct behavior — it shows the overall trend, not individual values.
Can I edit the equation text directly?
No. The equation updates automatically based on your trendline. If you want to change it, you must change the trendline type or your underlying data. You can copy the equation text and paste it elsewhere if you need to use it in a different format.
What if the equation text is too small to read?
Click the equation to select it, then drag one of the corner handles to make it larger. You can also right-click it, select "Format Text Box", and increase the font size in the panel that opens.
Does the equation update if I change my data?
Yes. If you add new data points or change existing ones, Excel recalculates the trendline and the equation automatically. The equation text on your chart updates to match.