Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Distance from linear trend

Posted on 2014-07-31
2
Medium Priority
?
160 Views
Last Modified: 2014-09-15
How do I calculate the distance from a linear trend in a line chart that goes up and down but steadily increasing?
0
Comment
Question by:fitaliano
2 Comments
 
LVL 99

Expert Comment

by:John Hurst
ID: 40233136
There are a number of ways, all under goodness of fit (which I forgot some decades back).

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.
0
 
LVL 27

Accepted Solution

by:
Glenn Ray earned 2000 total points
ID: 40233427
Excel has a function - TREND - which will calculate the linear trend value for any given x-value, based on a set of existing x and y values.  Using this, one can calculate the delta (distance) between any given y-value in the set and the linear trend value for the same value of x.  Here's the syntax:

=TREND((known_y's, [known_x's], [new_x's], [const]), where

known_y's is the range containing the y-values
known_x's is the range containing the x-values (optional if x is understood to be 1,2,3,4...)
new_x's is the range containing the "new" x-values to use for calculating the given linear trend point
const is TRUE is forcing the formula to intercept at y=0

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:
TREND exampleNote the formula entered in cell C2 (and copied down)
=TREND($B$2:$B$11,$A$2:$A$11,A2,TRUE)

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
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

886 members asked questions and received personalized solutions in the past 7 days.

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

Join & Ask a Question