+ Reply to Thread
Results 1 to 3 of 3

COUNTIF on a cell with commas..

  1. #1
    Registered User
    Join Date
    12-30-2007
    Posts
    3

    COUNTIF on a cell with commas..

    Hi guys,

    I have a range of cells that contain a list of names separated by commas..

    i.e Cell G1 contains :- Sam Rower,John Kennelly,Richard Scott
    Cell G2 contains :- Sam Rower,Richard West,Sam Rower,Bill Thomas
    Cell G3 contains :- Sam Rower

    I would like a column to the right of this that specifically counts the number of occurences of "Sam Rower" in the each cell....

    The criteria being that Sam Rower will always have a comma immediately after it.

    I have managed to do this for cell G3 with a simple countif formula, however it does not work with the comma separated cells. Any suggestions would be greatly appreciated

    Many thanks
    Last edited by jimmy mcmahon; 10-19-2011 at 07:03 AM.

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: COUNTIF on a cell with commas..

    maybe:
    Please Login or Register  to view this content.

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: COUNTIF on a cell with commas..

    put sam rower in say f1 then in h1 use
    =(LEN(G1)-LEN(SUBSTITUTE(UPPER(G1),UPPER($F$1),"")))/LEN($F$1)
    use of upper is to ignore case
    if its case sensitive just use
    =(LEN(G1)-LEN(SUBSTITUTE(G1,$F$1,"")))/LEN($F$1)
    Attached Files Attached Files
    Last edited by martindwilson; 10-19-2011 at 08:14 AM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ 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