Solved

Distance from linear trend

Posted on 2014-07-31
2
149 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 94

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel VBA 30 46
What is the alternative to the MIN function when you have to recognize a cell is blank? 5 27
Countdown Timer 2 17
Help with Excel 19 38
Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
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 Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

821 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