Your average is going to change each time around the loop.
Maybe one loop to calculate the sum, then calculate the average for the whole array (once), then another loop for the lesser, greater counts.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953