Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Capture Trend Line equation in Excel Chart and extend to mutiple value

Status
Not open for further replies.
Jul 23, 2009
16
US
have some data on an excel sheet which I had linked it to a chart. The data is monthly sales data for 12 months. The two columns are month no and sales amount. They are in column A and Column B.
I had linked the data to a chart and added a Trend line to it
I got a polynomial equation of 4th order for this Trend Line. It is
y = 6.833x4 - 66.33x3 + 227.1x2 - 208.6x + 152


y stands for sales which is in column B and x is the month no. which is column A
How can I capture this equation of the trend line in a string?
Currently, I have data for 12 months . But I would like to capture this Trend Line equation and extend it to another 6 months .
Hence, if I add more rows in Column A with month numbers, the column B should automatically be populated with Sales data ( projected or forecasted amounts )

The values in Column B ( for example, row 35 ) should read as
=(POWER($A35,4)*6.833)-(POWER($A35,3)*66.33)+(POWER($A35,2)*227.1)-(POWER($A35,1)*208.6) +152

How can I do that. Is there an Excel method or Excel VBA code to do that

Thanks
 
Presumably you know the data range that is being graphed. The Excel function, trend will do a linear fit. I think that for a polynomial fit you'll need to write your own (but I could certainly be wrong).

_________________
Bob Rashkin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top