Consulting

Results 1 to 5 of 5

Thread: Solved: Counting Substring Presence in Range

  1. #1
    VBAX Regular
    Joined
    Oct 2007
    Posts
    34
    Location

    Solved: Counting Substring Presence in Range

    I want to count how many cells contain a substring in a range using a worksheet cell function. I know countif, mid, etc but I don't know how to use mid in countif.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    TRy

    =COUNTIF(the_range,"*data*")
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Regular
    Joined
    Oct 2007
    Posts
    34
    Location
    duh, I forgot about that.

    Thanks!

  4. #4
    VBAX Regular
    Joined
    Oct 2007
    Posts
    34
    Location
    Actually, the problem is that I am referencing another cell for the data and it isn't a hard string. So I tried A12&"*" but that doesn't seem to work.

    Problem is that I have a name, ie Smith, John, however my list I'm searching for may or may not have a status appended to the name, ie "Smith, John (note)". I need to ignore the "(note)" part of just find the Smith, John part.

  5. #5
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    That should work

    =COUNTIF(the_range,A12&"*")
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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