Need help with returning selectable array

mrblister

Board Regular
Joined
Nov 20, 2016
Messages
207
Office Version
  1. 2021
Platform
  1. Windows
Hello!
For the following formula, if posted in D1 as an array formula, would give the results in column D:
Excel Formula:
=TRANSPOSE(LINEST($B$1:$B$5,$A$1:$A$5^{1,2,3}))

ABCD
1138.25
250-68.3929
310179.3571
450-114.8
5100

I want to modify the formula so that I can enter the polynomial order in C1. Something like this following formula, but this gives me an error:

Excel Formula:
=TRANSPOSE(LINEST($B$1:$B$5,$A$1:$A$5^switch(C1,1,{1},2,{1,2},3,{1,2,3},4,{1,2,3,4},0)))

Can anyone assist?
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Glad it's sorted & thanks for letting us know.
 
Upvote 0

Forum statistics

Threads
1,225,743
Messages
6,186,770
Members
453,370
Latest member
juliewar

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