Solved

Distance from linear trend

Posted on 2014-07-31
2
144 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 90

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 500 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Excel 2016 Hiding Toolbars 7 22
MIN, using ARRAY 4 16
Quickbooks - Merging data 3 0
Added a column screws up code 5 0
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now