COUNTIF counting incorrectly

D

Dave

Hi there excel gurus. I'm stumped as to how to rectify a bug in Excel2000
with the COUNTIF function. Simply put, the number is not coming up
correctly. I have a very simple function:

=COUNTIF(Current!D1:D10000,">=180")

which should give me everything in the column with a value of 180 or
greater, however, the number is off by a few. I'm getting 1531 when there
1537 records when I simply use the cursor to count. I found a Knowledge base
article that was possibly on it, but was unable to make the formula work
based on their suggestions. The last line of the data currently ends at 3700
something, but it will continue to grow, thus my 10k figure. Even changing
this to the last line does not alter the incorrect count.

Please advise!
 
T

T. Valko

What do you get with this formula:

=SUMPRODUCT(--(ISNUMBER(Current!D1:D10000)),--(Current!D1:D10000>=180))
 
N

Niek Otten

Maybe some of the cells are really text, although they look like numbers.
You can find out with the ISTEXT() function.

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

| Hi there excel gurus. I'm stumped as to how to rectify a bug in Excel2000
| with the COUNTIF function. Simply put, the number is not coming up
| correctly. I have a very simple function:
|
| =COUNTIF(Current!D1:D10000,">=180")
|
| which should give me everything in the column with a value of 180 or
| greater, however, the number is off by a few. I'm getting 1531 when there
| 1537 records when I simply use the cursor to count. I found a Knowledge base
| article that was possibly on it, but was unable to make the formula work
| based on their suggestions. The last line of the data currently ends at 3700
| something, but it will continue to grow, thus my 10k figure. Even changing
| this to the last line does not alter the incorrect count.
|
| Please advise!
 
M

Mike H

Dave

there is probably something wrong with your data in d1 - Dxxx

Put this in e1 or another helper column
=ISNUMBER(D1)
drag down and it should return TRUE for each number and FALSE for text.

Mike
 
D

Dave

I get just "0" as a value with this.

T. Valko said:
What do you get with this formula:

=SUMPRODUCT(--(ISNUMBER(Current!D1:D10000)),--(Current!D1:D10000>=180))
 
D

Dave

Mike,

I get all true for my fields with data, however after line 3670 (last night
filled in), I get false, as I would expect. I've used countif before without
having it count blank fields (that would be how it works, I thought).
 
D

Dave

Slight correction - d1 has a header, and gives me a FALSE, however cutting it
out and making the formula d2 to d10k does not change the incorrect count.
 
T

T. Valko

Ok, there's definitely a problem with your data.

I see other replies have made some suggestions but at this point I'd need to
see the data first hand to figure out what the problem is.

If you can/want to send a copy of the file I'll take a look. I'm at:

xl can help at comcast period net

Remove "can" and change the obvious. If the file is >1mb in size, zip it.
 
D

Dave

Due to the nature of the data, I was copying pieces of it into another
spreadsheet. Doing this, and posting them as values, rather than the
formulas used to fill them and saw that I was getting non whole numbers
(which were expected). On a whim, I used ROUNDUP, since any fraction might
as well be another whole unit, and after using this I now have the correct
numbers.

Thanks for all your help, both you and others. Trying to send you the data
actually helped me fix it!
 
T

T. Valko

Glad you got it straightened out! Thanks for letting us know. We appreciate
feedback!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top