I'm stumped. I have a column of data such as the simplified version
below. For the example, for the eleven numbers below, the average is
3.0. I want to count the number of runs. A run is a continous set of
values above or below the mean. I've marked the runs in the example.
As soon as the series crosses the mean, a new run starts. This example
has four runs. Any ideas on a formula to calculate it?

1 run 1
2 run 1
5 run 2
6 run 2
1 run 3
1 run 3
2 run 3
3 equal to mean/not part of a run
4 run 4
4 run 4
4 run 4

Thanks.

- John