Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
waxwing
 
Posts: n/a
Default Count number of runs above or below average

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

  #2   Report Post  
Harlan Grove
 
Posts: n/a
Default

waxwing wrote...
....
. . . 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


You're already close. Use a second column along side your data column.
If your data were in A1:A11, enter the following formulas.

B1:
=IF(A1<AVERAGE(A$1:A$11),1,"")

B2:
=IF(AND(SIGN(A2-AVERAGE(A$1:A$11))<{0;1}*SIGN(A1-AVERAGE(A$1:A$11))),
MAX(B$1:B1)+1,"")

Select B2 and fill it down into B3:B11. The number of runs would be
given by both COUNT(B1:B11) and MAX(B1:B11).

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count Number of Characters in a cell? AHJuncti Excel Discussion (Misc queries) 2 June 16th 05 07:39 PM
Is it possible to count if within a number region? themax16 Excel Discussion (Misc queries) 3 May 22nd 05 06:46 PM
count number of years 2003 in a range of dates Stan Altshuller Excel Worksheet Functions 2 May 3rd 05 07:15 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM
Count the number of words in a cell! Doom3 Excel Worksheet Functions 4 November 23rd 04 06:00 AM


All times are GMT +1. The time now is 05:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"