Excel Countif Modulus on list of values

Hi Experts

I've got the following sample data in a single column in my XLS:

130.18
129.34
128.08
129.21
129.69
130.58
130.94
130.66
131.39
131.45
131.95
132.26

I need a formula to calculate the number of values in this data range that have a modulus of 0.35 to 0.50 (both values inclusive) - the correct answer is: 2

What is the formula I should use?
Who is Participating?

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Analyst Assistant Commented:
Perhaps.

=SUMPRODUCT(--(MOD(A1:A12,1)>=0.35),--( MOD(A1:A12,1)<=0.5))
Author Commented:
Thanks Norie - this looks promising, however I just tried the following on this set of values and it should return a result of 2, but instead it returns a result of 1...

=SUMPRODUCT(--(MOD(C59:C70,1)>=0.18), --(MOD(C59:C70,1)<=0.21))

Seems like it isn't including one of the values 0.18 or 0.21 ...?
Author Commented:
Testing further, it seems like it is the less than or equal to value (<=0.21) which it isn't including correctly, because if I change the formula to the following:

=SUMPRODUCT(--(MOD(C59:C70,1)>=0.18), --(MOD(C59:C70,1)<=0.22))

it returns the correct result of 2. Why does the <= function not work correctly? It seems to be ignoring the = to part of only working on the < part...
Analyst Assistant Commented:
Can you show the other set of data you tried it on?

Author Commented:
Hi Norie - please see attached file. The result for the formula should be 3, but Excel shows 2
demo.xlsx
Analyst Assistant Commented:
I think this is a caused by the way Excel, well computers, store decimalnumbers, see here.

If we use the ROUND function to round to 2 decimal places the correct result is returned.

=SUMPRODUCT(--(ROUND(MOD(A1:A12,1),2)>=0.21), --(ROUND(MOD(A1:A12,1),2)<=0.34))

Experts Exchange Solution brought to you by