How to Show Equation in Excel Graph

Cody Schneider7 min read

Displaying a trendline on an Excel graph is helpful, but seeing the mathematical equation behind that trendline transforms your chart from a simple picture into a powerful analytical tool. This article will guide you through the simple steps to add and format an equation on your Excel chart, explain which type of trendline in Excel to choose for your data, and show you how to use that equation for practical forecasting.

GraphedGraphed

Build AI Agents for Marketing

Build virtual employees that run your go to market. Connect your data sources, deploy autonomous agents, and grow your company.

Watch Graphed demo video

Why Bother Showing an Equation on Your Graph?

Adding an equation to your chart isn't just an academic exercise for statisticians, it provides tangible value for marketers, sales analysts, and business owners. It upgrades your analysis in several key ways:

  • Forecasting and Prediction: This is the biggest benefit. Once you have the equation, you can plug in future values to predict outcomes. For instance, if you have an equation that links ad spend to website traffic, you can estimate how much traffic a future ad budget will generate.
  • Quantifying Relationships: An equation shows you the exact relationship between your variables. Instead of just saying, "sales increase when we spend more on ads," you can say, "for every extra dollar in ad spend, sales increase by $4.50." This level of precision is critical for making smart budget decisions.
  • Model Portability: You can take the equation out of Excel and use it anywhere - in another piece of software, in a presentation slide, or as part of a larger business model. It becomes a portable piece of logic derived from your data.
  • Improved Clarity: For team members or stakeholders viewing your report, the equation provides immediate context. It makes the chart's story self-contained, showing both the visual trend and the math that backs it up.

The Core Steps: Adding a Trendline and its Equation

Let's walk through the process using a common business scenario: analyzing the relationship between monthly ad spend and website sessions. You should start with a basic scatter plot or line chart that maps your two variables.

Imagine you have this simple data set in your sheet:

Step 1: Select Your Chart's Data Series

First, click on one of the data points in your chart. This will select the entire data series (all the blue dots in our example).

Free PDF · the crash course

AI Agents for Marketing Crash Course

Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.

Step 2: Add a Trendline

With the data series selected, right-click on any of the data points. A context menu will appear. From this menu, select Add Trendline....

Step 3: Display the Equation

As soon as you click "Add Trendline," Excel will add a default linear trendline to your chart and open the Format Trendline pane on the right side of your screen. This is where the magic happens.

In the "Format Trendline" pane, ensure you are in the Trendline Options tab (it looks like a small column chart). Scroll down to the bottom of the options available. You'll see several checkboxes. Check the one that says Display Equation on Chart.

A text box with the trendline's equation will immediately appear on your chart. Congratulations, you’ve done it!

Bonus Tip: Display the R-squared Value

Just below the "Display Equation on Chart" checkbox, you'll see one for Display R-squared value on chart. It's almost always a good idea to check this box, too.

The R-squared value, ranging from 0 to 1, tells you how well your data points fit the trendline. An R-squared of 0.94 suggests that 94% of the variation in website sessions can be explained by the variation in ad spend, which indicates a very strong fit.

GraphedGraphed

Build AI Agents for Marketing

Build virtual employees that run your go to market. Connect your data sources, deploy autonomous agents, and grow your company.

Watch Graphed demo video

Choosing the Right Type of Trendline

Excel defaults to a "Linear" trendline, but that isn't always the best representation of your data's story. In the same "Format Trendline" pane, you can select from several different models. Here’s a quick guide to the most common ones and when to use them.

Linear

A linear trendline is best used when your data points follow a straight line. It describes a constant-rate relationship.

  • Equation Form: y = mx + b
  • Use It When: Your dependent variable (y) increases or decreases at a steady rate as your independent variable (x) increases.
  • Example: The relationship between the number of hours you work and the amount of money you make (assuming a fixed hourly wage). For every additional hour worked, your earnings increase by a constant amount.

Logarithmic

A logarithmic trendline is ideal for data that rises or falls sharply at the beginning and then starts to level off over time.

  • Equation Form: y = c ln(x) + b
  • Use It When: The rate of change slows down as the x-values increase. Think diminishing returns.
  • Example: A new team member's productivity. They learn quickly in the first few weeks (sharp increase), but their rate of improvement slows as they master the job's core functions.

Polynomial

A polynomial trendline is useful for data with fluctuations - hills and valleys. Because it's so flexible, it can describe more complex relationships.

  • Equation Form: y = c₂x² + c₁x + b (for Order 2)
  • Use It When: You observe one or more peaks or troughs in your data. Be cautious with the "Order" setting, a higher order can create a line that perfectly weaves through your existing points but is terrible at predicting future ones (a phenomenon known as overfitting). An order of 2 or 3 is usually sufficient.
  • Example: The relationship between daily temperature and energy consumption. Consumption might be high when it's very cold (heating), low in mild weather, and high again when it's very hot (air conditioning), creating a "U" shape.

Exponential

An exponential trendline is your go-to for data where the growth rate itself is increasing. This is the model for "J-curve" growth.

  • Equation Form: y = ceᵇˣ
  • Use It When: Your values are growing or shrinking by a percentage, not a fixed amount. Think compounding.
  • Example: Viral content on social media. 10 shares become 100, which become 1,000. The number of new shares grows in proportion to the current total, leading to explosive growth.

Tidying Things Up: Customizing the Equation's Appearance

Excel places the equation in a default location, but you can easily move and format it for better readability.

  • Move It: Click once on the equation's text box. When the four-way arrow cursor appears, you can drag and drop it to any empty space on your chart where it's easy to see.
  • Format It: With the text box selected, use the formatting options in the "Home" tab on the Excel ribbon to change the font size, make the text bold, or change its color to stand out.
  • Add Context: While you can click directly into the formula box to add descriptive text (like "Sales Model: "), this can be risky as you might accidentally alter the equation. A better strategy is to add a separate text box (Insert > Text Box) next to the equation for any labels or explanations.

Free PDF · the crash course

AI Agents for Marketing Crash Course

Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.

Putting Your Equation to Work (Forecasting in Excel)

Now that you have the equation, let's use it. Look at the equation from our example chart: y = 20.983x + 4725.1

In this model:

  • y represents Website Sessions.
  • x represents Ad Spend.

What if you plan to spend $800 on ads next month? You can easily forecast the expected website sessions.

Pick any empty cell in your spreadsheet and type in the formula, replacing x with your new value (your planned $800 spend).

=20.983 * 800 + 4725.1

Excel calculates the result: ~21,511 sessions. Just like that, you’ve moved from analyzing past data to predicting future performance, directly from the model visualized in your chart.

Final Thoughts

Showing an equation on an Excel chart bridges the gap between raw data and actionable strategy. By choosing the right trendline, displaying its formula, and using that formula for forecasting, you equip yourself with a simple yet powerful method for making genuinely data-driven decisions.

We know that even with these tips, creating reports in spreadsheets often feels like manual busywork. That's why we built Graphed. We connect directly to your marketing and sales platforms (like Google Analytics, Shopify, Facebook Ads, or HubSpot) and let you use simple, plain English to create live dashboards. Instead of clicking through menus to find and display an equation, you can just ask, "Show me my sessions vs ad spend as a chart with a trendline" and get instant, always-up-to-date results.

Related Articles