Hi all,

..I am working on a statistical process control "run" chart, and I was wondering if there is any easy (?), formula that I could use to see if there was a running trend in the data.

ie, I need to flag up if there are 7 consecutive data points that are all either increasing, or decreasing, (Ideally would like to be able to "key in" the number to trend. eg ideally 7, but could also be 5).

My initial thought is that I would have to have 2 columns and use a lot of "nested" if / and statements to look at the preceding 7 data points, one column checking "upward trends, the other reducing trends. I think this would work but is a bit "messy", and I weas hoping for a neater solution.

Thanks,

Stu