July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Become a Premium Member and unlock a new, free course in leading technologies each month.

Solved

Posted on 2014-07-31

How do I calculate the distance from a linear trend in a line chart that goes up and down but steadily increasing?

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

- Help others & share knowledge
- Earn cash & points
- Learn & ask questions

2 Comments

The simplest way (if the numbers are positive and you have a good regression line) is to calculate the y value on the line for the x value of the point.

The vertical distance between the line is y(line) - y(point).

That is one way and that is not the only way.

In your case, you'll use your existing data for all the x and y values, then use each individual value of x to produce the linear trend value. From there you just substract that value from the original y-value to get the delta (distance).

See this example of how you'd do it:

Note the formula entered in cell C2 (and copied down)

You can see from the chart and linear trend on it the the deltas agree with what's seen visually. Example file attached.,

Regards,

-Glenn

Microsoft Reference: TREND function

EE-TrendExample.xlsx

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a serious pitfall that can happen when deleting shapes using VBA.

Earn Certification

HTML5 Specialist - Certification

Free withPremium

Course of the Month4 days, 7 hours left to enroll

Join the community of 500,000 technology professionals and ask your questions.