how to count values less than or greater than of a given value