Monday 30 July 2012

Polynomial equations in excel

Polynomial equations in excel: Download Polynomial Formula Excel

You all must be thinking what a topic for a software professional.
After a long time I had put a depth efforts to build one excel formula to get polynomial equation value.


I have taken following reference Material:
3rd Order Polynomial Trendline
     Equation: y = (c3 * x^3) + (c2 * x^2) + (c1 * x^1) + b
     c3: =INDEX(LINEST(y,x^{1,2,3}),1)
     c2: =INDEX(LINEST(y,x^{1,2,3}),1,2)
     C1: =INDEX(LINEST(y,x^{1,2,3}),1,3)
     b: =INDEX(LINEST(y,x^{1,2,3}),1,4)

     http://office.microsoft.com/en-us/excel-help/linest-HP005209155.aspx

Based on the above I have created a 6th order Polynomial trend-line.
Assuming:
1) B2:B9 is x axis
2) C2:C9 is y axis
3) A2 is x

=(INDEX(LINEST(C2:C9,B2:B9^{1,2,3,4,5,6}),1)*A2^6)+(INDEX(LINEST(C2:C9,B2:B9^{1,2,3,4,5,6}),1,2)*A2^5)+(INDEX(LINEST(C2:C9,B2:B9^{1,2,3,4,5,6}),1,3)*A2^4)+(INDEX(LINEST(C2:C9,B2:B9^{1,2,3,4,5,6}),1,4)*A2^3)+(INDEX(LINEST(C2:C9,B2:B9^{1,2,3,4,5,6}),1,5)*A2^2)+(INDEX(LINEST(C2:C9,B2:B9^{1,2,3,4,5,6}),1,6)*A2^1)+INDEX(LINEST(C2:C9,B2:B9^{1,2,3,4,5,6}),1,7)

Share your feedback for sure.

Regards,
Sagar