Perplexed with Countif

L

Lloyd H. London

I have a column with a number of text entries, the range is B2:B7844.
One of many entries in the column is Green Valley.
To count those cells with Green Valley entered, I have used the Countif
function.
The exact formula is =countif(B2:B7844,"Green Valley").
The formula is returning a result of 0 (zero). What is wrong with my
formula. The format was originally General, and I have tried to
reformat as Text, with no change.
I am using Excel 2002.
 
P

Peo Sjoblom

You probably have either leading or trailing spaces, try

=COUNTIF(B2:B7844,"*Green Valley*")
 
P

Peo Sjoblom

And just in case there are extra spaces between the words

=SUMPRODUCT(--(ISNUMBER(FIND("Green Valley",TRIM(B2:B7844)))))

which is case sensitive

=SUMPRODUCT(--(ISNUMBER(SEARCH("Green Valley",TRIM(B2:B7844)))))

which is not
 
L

Lloyd H. London

Excellent call. It was a space after, now fixed. I used
=left(b2,len(B2)-1) and pasted values on top of the existing data (in a
copy of the file). I then used countif and counta to make sure numbers
matched up.
Thanks
 

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