View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Domenic[_2_] Domenic[_2_] is offline
external usenet poster
 
Posts: 265
Default Building Non-Contiguous Arrays For Use With Linest

In article
,
Marston wrote:

Something seems a bit off.
Shouldn't Small have an array and a k value as parameters? What's the
K value in this equation?


The array for the SMALL function is...

IF(B2:B100=5,ROW(B2:B100)-ROW(B2))

The K value for the SMALL function is actually an array of values...

ROW(INDIRECT("1:"&COUNTIF(B2:B100,5)))

As I mentioned in my previous post, the two formulas I offered each
return an array of values and are used as the arguments for the LINEST
function.

For example, select two cells in a horizontal range, let's say E2:F2,
enter something like the following formula...

=LINEST(N(OFFSET(C2:C100,SMALL(IF(B2:B100=5,ROW(B2 :B100)-
ROW(B2)),ROW(INDIRECT("1
:"&COUNTIF(B2:B100,5)))),0,1)),N(OFFSET(A2:A100,SM ALL(IF(B2:B100=
5,ROW(B2:B100)-ROW(B2)),ROW(INDIRECT("1
:"&COUNTIF(B2:B100,5)))),0,1)))

....and then confirm with CONTROL+SHIFT+ENTER, not just ENTER. If done
correctly, Excel will automatically place curly brackets around the
formula.

Does this help?