ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   COUNTIF not counting properly!! Character limit? (https://www.excelbanter.com/excel-worksheet-functions/68260-countif-not-counting-properly-character-limit.html)

kytihu

COUNTIF not counting properly!! Character limit?
 

I have a list of cells with text. I want to count how many times each
unique text cell appears. However, countif is having trouble
accurately distinguishing between unique cells

Ex:
ALLSTATE INSURANCE CO.VAN??
ALLSTATE INSURANCE CO.VANIL

If I were to ask it how many times ALLSTATE INSURANCE CO.VAN?? appeared
in this range of two cells, it would tell me 2, although the correct
answer is obviously 1. Is there a character limit for countif? Why is
it missing this simply calculation?


--
kytihu
------------------------------------------------------------------------
kytihu's Profile: http://www.excelforum.com/member.php...o&userid=30971
View this thread: http://www.excelforum.com/showthread...hreadid=506388


Ron Coderre

COUNTIF not counting properly!! Character limit?
 

If you are trying to match a literal question mark (which is a wildcard
for any single character) you need to prepend a tilde (~) to it.

=COUNTIF(E7:E8,"ALLSTATE INSURANCE CO.VAN~?~?")

Otherwise, without the tildes,
=COUNTIF(E7:E8,"ALLSTATE INSURANCE CO.VAN??")
will match on ALLSTATE INSURANCE CO.VAN followed by any 2 characters.


Does that help?

Regards,
Ron


--
Ron Coderre
------------------------------------------------------------------------
Ron Coderre's Profile: http://www.excelforum.com/member.php...o&userid=21419
View this thread: http://www.excelforum.com/showthread...hreadid=506388


kytihu

COUNTIF not counting properly!! Character limit?
 

That's exactly it. It was reading the ?? as "any 2 letters" i guess.

Thanks!


--
kytihu
------------------------------------------------------------------------
kytihu's Profile: http://www.excelforum.com/member.php...o&userid=30971
View this thread: http://www.excelforum.com/showthread...hreadid=506388



All times are GMT +1. The time now is 04:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com