How to use the linest function to calculate a polynomial trendline
02:42 12 Nov 2020

So I did some research online to get a Excel formula to calculate a polynomial trendline. And I found the following formula's:

y = (a1 * x^2) + (a2 * x) + b

a1: =INDEX(LINEST(y;x^{1,2});1)
a2: =INDEX(LINEST(y;x^{1,2});1;2)
 b: =INDEX(LINEST(y;x^{1,2});1;3)

But when I try to use these in my excel sheet, I got other values for a1 and a2 than excel gives me when I create a graph with a trendline and display the equation on the chart. and for "b" I got a #REF error. (see the picture below)

example of the situation

Can anyone help me to get this problem solved?

excel excel-formula polynomials