# Linest - Polynomial for higher order

1. ## Linest - Polynomial for higher order

Hi,

I am using the
Formula:
`Please Login or Register  to view this content.`
array function to determine the coefficients of a polynomial 2nd order.

As shown on the attached, the coefficients for the 2nd order are highlighed in black.

If my best fit curve is polynomial of the order 3 OR 4, how do I get the coefficients.

2. ## Re: Linest - Polynomial for higher order

Hi,

I have this webpage in my favourites https://people.stfx.ca/bliengme/exce...polynomial.htm

It gives an example of a 3rd order line, but I think you can extend as required.

3. ## Re: Linest - Polynomial for higher order

I tend to use this:

=IFERROR(INDEX(LINEST(\$B\$2:\$B\$21,\$C\$2:\$C\$21^TRANSPOSE(ROW(\$1:\$2))),1,ROWS(F\$2:F2)),"")

copied down. The bit in red defines the order of the polynomial. In this case, the first value is the C2 value, the secons is the C1 value and the third is b. See file, where it is also done for a 5th order polynomial.

These are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

You will know the array is active when you see the curly brackets { } appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

Don't type the curly brackets yourself - it won't work...

There are currently 1 users browsing this thread. (0 members and 1 guests)