+ Reply to Thread
Results 1 to 4 of 4

Parse names and count them

  1. #1
    Registered User
    Join Date
    08-02-2013
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    3

    Parse names and count them

    Hi guys, I have a table with several names in one field, separated by semicolons. I want to be able to count how many times every name appears and graph the data.
    Example:

    Item 1 | First Last; First2 Last2; First3 Last3 |
    Item 2 | First Last |
    Item 3 | First Last; First2 Last2; |

    I'm able to parse the names via the "data to columns" wizard, but I can't figure out how to get it all into one chart nicely because the hierarchy stuff in pivot tables keeps messing it up.

    Thanks!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,433

    Re: Parse names and count them

    Just have a column with a count of the semicolons plus 1. That can be obtained using,for example, =LEN(A1)-LEN(SUBSTITUTE(A1,";","")+1

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Parse names and count them

    Or, assuming you want a count of specific, individual names from that column (covering A2:A100, say), and that you have a list of all those names for which you wish to obtain this count, beginning in cell B2 (for example), enter this formula in cell C2 and copy down as required:

    =SUMPRODUCT(LEN($A$2:$A$100)-LEN(SUBSTITUTE($A$2:$A$100,B2,"")))/LEN(B2)

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  4. #4
    Registered User
    Join Date
    08-02-2013
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Parse names and count them

    Thanks for the replies, but I think I didn't explain myself well - I don't want to count how many names are in a table, I want to count how many times every name appears. Ideally, the output would be something like:
    First1 Last1 // 2
    First2 Last2 // 5
    First3 Last3 // 1

    If possible, I'd like to not have to put the names in a table beforehand to compare them, because I will have to keep adding new names to the table when an item appears.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro to Parse Company Names
    By Paul.Stulov in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-14-2012, 12:45 PM
  2. macro to parse and count the entities in a field
    By kunalg in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 09-04-2012, 08:06 AM
  3. Parse contact names
    By petzl in forum Excel General
    Replies: 9
    Last Post: 08-22-2007, 07:49 AM
  4. Count Names-How do I get
    By Diana in forum Excel General
    Replies: 3
    Last Post: 09-22-2005, 01:05 PM

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