LINEST IGNORE BLANKS - Polynomial translation

skavorn

New Member
Joined
Jan 31, 2013
Messages
7
Hi All,

I'm trying to use formulas to recreate the polynomial trendlines on the line graphs.

As you can see in the screenshot below (and attachment), I've created a formula which correctly outputs the polynomial output, however it doesn't work when there's blanks.

Surely it's possible because Excel clearly does itself so I'm looking for the formula to spit out the same results as per the formula on the graph labelled "AL7"

I've tried finding results for this online but not managed to get anything that works for me.

I hope you can help.

1635372846723.png
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
I worked on pretty much this exact question here:


I first came up with the matrix formulas, but settled on the same formula you used. But as you've seen, empty cells cause problems. We never came up with an answer. What version of Excel do you have? If you have Excel 365, the FILTER function might work well here. If not, it may require some VBA.
 
Upvote 0
If you have a newer version of Excel that uses dynamic arrays, enter the following formula in cell J1 . . .

VBA Code:
=LET(Rng, FILTER(B3:J10,(LEN(B3:B10)>0)*(LEN(J3:J10)>0)),LINEST(INDEX(Rng,0,9),INDEX(Rng,0,1)^{1,2,3,4,5,6}))

Otherwise, first select cells J1:P1, then enter the following formula, and then press CONTROL+SHIFT+ENTER....

VBA Code:
=LINEST(INDEX(J:J,N(IF(1,MODE.MULT(IF(ISNUMBER(J3:J10),ROW(J3:J10)*{1,1}))))),INDEX(B:B,N(IF(1,MODE.MULT(IF(ISNUMBER(B3:B10),ROW(B3:B10)*{1,1})))))^{1,2,3,4,5,6})

Adjust the ranges accordingly.

Hope this helps!
 
Upvote 0
If you have a newer version of Excel that uses dynamic arrays, enter the following formula in cell J1 . . .

VBA Code:
=LET(Rng, FILTER(B3:J10,(LEN(B3:B10)>0)*(LEN(J3:J10)>0)),LINEST(INDEX(Rng,0,9),INDEX(Rng,0,1)^{1,2,3,4,5,6}))

Otherwise, first select cells J1:P1, then enter the following formula, and then press CONTROL+SHIFT+ENTER....

VBA Code:
=LINEST(INDEX(J:J,N(IF(1,MODE.MULT(IF(ISNUMBER(J3:J10),ROW(J3:J10)*{1,1}))))),INDEX(B:B,N(IF(1,MODE.MULT(IF(ISNUMBER(B3:B10),ROW(B3:B10)*{1,1})))))^{1,2,3,4,5,6})

Adjust the ranges accordingly.

Hope this helps!
For anyone reading this this one worked for me. I didn't need to even turn it into an array for it to work
=LET(Rng, FILTER(B3:J10,(LEN(B3:B10)>0)*(LEN(J3:J10)>0)),LINEST(INDEX(Rng,0,9),INDEX(Rng,0,1)^{1,2,3,4,5,6}))

@ Domenic you're a star!

@ Eric W - note Dominic's solution to the problem.

Thank you!
 
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,971
Members
452,371
Latest member
Frana

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top