PDA

View Full Version : Any Excel gurus out there?



GofBorg
01-Jun-2012, 20:40
Just wondering why I cannot get countif function to work.

A

04
03
09
01
12
02
06
etc...

=COUNTIF(A1:A152,"=09") always results in 0.

GofBorg
01-Jun-2012, 20:42
Nevermind, apparently the data had some invisible padding after each number
so it wasn't a match.

MichaelC
01-Jun-2012, 20:44
On 01/06/2012 20:40, GofBorg wrote:
> Just wondering why I cannot get countif function to work.
>
> A
>
> 04
> 03
> 09
> 01
> 12
> 02
> 06
> etc...
>
> =COUNTIF(A1:A152,"=09") always results in 0.

This is because that COUNTIF is looking for a text string of =09
If that column data really is text, then simply change it to
=COUNTIF(A1:A152,"09")

Michael
--
"I've got the key to the gates of paradise, but I've got too many legs!"

GofBorg
01-Jun-2012, 20:54
> This is because that COUNTIF is looking for a text string of =09
> If that column data really is text, then simply change it to
> =COUNTIF(A1:A152,"09")

Actually no, there are numerous correct syntax for matching.
Yours is one, mine is another and there are other acceptable queries.
I wouldn't have guessed it was correct either, but I just read up on
the subject ant to me it is easier to read and understand the logic.
That's why I added the equals. Turned out the issue was a hidden
character from the data import. I got rid of it throughout and now
it's all peachy. Thanks for the assist though!