LINEST Array for a specific sub segment

CJBAMBAM

New Member
Joined
May 3, 2018
Messages
2
Hi guys,

I am using LINEST Array to calculate price elasticity and its related coefficients. For a multi-product portfolio.

Y values: Monthly Price elasticity for each SKU
X Values: Coefficitents for 5 items:
  • Season (4 separate coefficients)
  • Relative price level vs substitute products

Right now, I am using a formula as follows: {=LINEST(Y Values,X Values^{1,2,3,4,5},TRUE,FALSE)}

As the data I am analyzing has a number of SKUs. I want to only pull the relevant X (coefficient) and Y (monthly elasticity) values for each product. Right now I am doing this manually :)laugh:), but would like to automate the process. How can I do this?

Thanks very much in advance. I have not been able to replicate other posts that are using LINEST Array's with conditions to replicate this process.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Let's assume that we have the following data...

A1:C11

ProductY ValuesX Values
B13100
A
A
B24500
B34400
A
A
B45400
B57500
B68100

<tbody>
</tbody>
To perform a LINEST calculation based on Product B, try the following formula that needs to be confirmed with CONTROL+SHIFT+ENTER...

Code:
=SUM(LINEST(INDEX(C2:C11,N(IF(1,MODE.MULT(IF(A2:A11="B",(ROW(A2:A11)-ROW(A2)+1)*{1,1}))))),INDEX(B2:B11,N(IF(1,MODE.MULT(IF(A2:A11="B",(ROW(A2:A11)-ROW(A2)+1)*{1,1}))))))*{9,1})

For earlier versions of Excel, try the following instead that also needs to be confirmed with CONTROL+SHIFT+ENTER...

Code:
=SUM(LINEST(N(OFFSET(C2:C11,SMALL(IF(A2:A11="B",ROW(A2:A11)-ROW(A2)),ROW(INDIRECT("1:"&COUNTIF(A2:A11,"B")))),0,1)),N(OFFSET(B2:B11,SMALL(IF(A2:A11="B",ROW(A2:A11)-ROW(A2)),ROW(INDIRECT("1:"&COUNTIF(A2:A11,"B")))),0,1)))*{9,1})

Hope this helps!
 
Upvote 0
Flawless, thanks Domenic!

Due to my data set the formula is ~10x longer, but that worked great.

Chris
 
Upvote 0

Forum statistics

Threads
1,213,494
Messages
6,113,981
Members
448,538
Latest member
alex78

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