Multivariable LINEST with X's in different non-adjacent columns

Z

zutalors212

Suppose that I have Y in column A; X1 in column B, and X2 in Column D.
How do I perform the linear regression without cutting/pasting X2 to be
next to X1?

I am keenly familiar with LINEST.
 
J

Jerry W. Lewis

The x columns must be contiguous in the call to LINEST. If they are not
contiguous in the worksheet, and you do not want to make them so, then you
will have to construct an array formula that will do it for you. You might
try something like

=LINEST(A1:A6, IF(COLUMN(B1:C6)=2,B1:B6,D1:D6) )

Jerry
 
H

Harlan Grove

Jerry W. Lewis wrote...
....
will have to construct an array formula that will do it for you. You might
try something like

=LINEST(A1:A6, IF(COLUMN(B1:C6)=2,B1:B6,D1:D6) )
....

More flexible to use {1,0}*B1:B6+{0,1}*D1:D6.
 
Top