# Trendline & Variable column lenght

#### Makk14

##### Board Regular
Hello,

1) I am trying to create Trendline that is not actually a Trendline pre se.
I have in one column set of numbers that represent results for a certain period. I am trying to show in cell A1 a trend - if the results are getting better or no.

E.G.
Column B
1
2
3
5

Cell A1 = "Results are improving"

Column B
5
4
1
1
0

Cell A1 = "Results are falling"

2) My another issue is that the length of the column can vary, so I can't have the formula fixed. Is there a formula that would select all the cells in the column that are not empty and that I can use in the above problem?

### Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

#### Zack Barresse

##### MrExcel MVP
i'm not too sure on what your looking for here, but maybe something like this??...
Book5
ABCD
1UP1
22
33
44
55
66
77
88
99
102
Sheet1

formula in a1 is...
=IF(TREND(B1:OFFSET(B1,COUNTIF(B1:B65535,"<>")-1,0))>AVERAGE(B1:OFFSET(B1,COUNTIF(B1:B65535,"<>")-1,0)),"Down","UP")

#### Zack Barresse

##### MrExcel MVP
btw, data must be contiguous, blanks won't help this solution at all. null's or zero's are accepted, but will throw off the average formula.

Replies
3
Views
288
Replies
33
Views
904
Replies
3
Views
265
Replies
6
Views
270
Replies
3
Views
280

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,152,096
Messages
5,768,058
Members
425,451
Latest member
JohnBrooksBiddle

### 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.

### Which adblocker are you using?

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

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