rrussell said:
I still need to exclude 0 and blank entries. I have built the references into the formula so I would be able to copy it into different tables without having to define new references.
Not because you would be interested, but others might...
aaLINESTwithEmptyCells rrussell.xls |
---|
|
---|
| A | B | C | D | E | F | G | H | I | J | K |
---|
1 | | | | | | | | | | | |
---|
2 | 5 | 0.205882 | | | | | | | | | |
---|
3 | Range-1 | Range-2 | Pos | | | | | | | | |
---|
4 | 1 | 3 | 1 | | | | | | | | |
---|
5 | 3 | 6 | 3 | | | | | | | | |
---|
6 | 2 | 6 | 4 | | | | | | | | |
---|
7 | 8 | 7 | 6 | | | | | | | | |
---|
8 | 6 | 3 | 8 | | | | | | | | |
---|
9 | | | | | | | | | | | |
---|
10 | | | | | | | | | | | |
---|
11 | | | | | | | | | | | |
---|
12 | | | | | | | | | | | |
---|
13 | | | | | | | | | | | |
---|
14 | | | | 1 | | 3 | 2 | 0 | 8 | 0 | 6 |
---|
15 | | | | 3 | 4 | 6 | 6 | | 7 | | 3 |
---|
16 | | | | | | | | | | | |
---|
|
---|
A2:
=SUMPRODUCT(--(D14:K14<>""),--(D15:K15<>""))
A4, copied down:
=IF(N($C4),INDEX($D$14:$K$14,1,$C4),"")
B2:
=LINEST(B4:INDEX(B4:B65536,A2),A4:INDEX(A4:A65536,A2))
B4:
=IF(N($C4),INDEX($D$15:$K$15,1,$C4),"")
C4:
=IF(ROW()-ROW(C$4)+1<=$A$2,SMALL(IF($D$14:$K$14*$D$15:$K$15,COLUMN($D$14:$K$14)-COLUMN($D$14)+1),ROW()-ROW(C$4)+1),"")
which is confirmed with control+shift+enter then copied down.