I am trying to understand, counting no of elements which are less than mean and the greater than mean using a formula.
[2, 1, 2, 6, 5, 5, 6, 5, 8]
I think I can calculate the mean and find out number of occurrences of where each element is less than or greater than the mean.
Is there any formula for this?
For cases with $n$ numbers in your list, there could be as few as $1$ and as many as $n-1$ numbers less than the mean; and similarly for the amount of numbers greater than the mean. So I don't see how you could get a formula of the type you are asking about.