AMY: You can see, just like I did, the wisdom and accuracy of David's reply
by testing it with a small sample. What I did is enter 4998, 4999, 5000,
9998, 9999, 10000, and 10001 into cells A1 to A7.
With this small sample, you can easily see that there is only 1 number *less
than* 4999 while there are 2 number *greater than* 9999. If Roger's formula
(as corrected by David) was doing what you said it was, it would return -1.
In contrast, it is correctly returning 2 representing the numbers 5000 and
9998, the two numbers in the sample that meet both conditions of being
greater than 4999 AND less than 9999.
Alternatively, you can also simply change substitute 9998 for 9999 in
Roger's formula and you would get the same results as David proposed.
Another way of looking at this is the formula is counting all numbers in
column A that are greater than 4999 (which in my sample is 5) and subtracting
from that the count of numbers that are greater than 9998 (which in my sample
is 3) returning a result of 2.
I know this is very verbose but I'm really doing this to personally learn
this stuff. I find that one of the best ways to test whether I have learned
something is trying to explain it to someone else. As my username suggests,
I'm just TRYING to learn. I learn a lot about logic and thinking outside the
box from these guys.