+ Reply to Thread
Results 1 to 3 of 3

COUNTIF not counting properly!! Character limit?

  1. #1
    Registered User
    Join Date
    01-30-2006
    Posts
    2

    Angry 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?

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996
    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

  3. #3
    Registered User
    Join Date
    01-30-2006
    Posts
    2
    That's exactly it. It was reading the ?? as "any 2 letters" i guess.

    Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1