+ Reply to Thread
Results 1 to 4 of 4

Formula to count names

  1. #1
    Registered User
    Join Date
    09-09-2011
    Location
    Waynesburg, Pa
    MS-Off Ver
    Excel 2010
    Posts
    2

    Formula to count names

    I searched the forums but haven't found an answer that works for me. I'm trying to count the number of times a name appears in a column.

    A1 - Tom
    A2 - Tom, Harry
    A3 - Joe, Tom
    A4 - Tom
    A5 - Tom, Bill

    I want to count Tom in the list.

    I've tried =countif(A1:A5,"Tom") which give the answer of 2.

    On another forum I found this one =SUMPRODUCT(--(COUNTIF(OFFSET(A1:CH1,ROW(A1:A5)-ROW(A1),),"Tom")>0)) also gave me the answer 2.

    Ideas??
    Last edited by jdepriest; 09-09-2011 at 01:29 PM.

  2. #2
    Forum Contributor
    Join Date
    06-09-2011
    Location
    Germany
    MS-Off Ver
    Excel 2016
    Posts
    194

    Re: Formula Help

    Hi jedepriest,

    try adding wildcards:
    =COUNTIF(A:A;"*Tom*")

    Regards

    Theo
    __________________
    Please consider:

    Thanking those who helped you. Click the scales icon in the upper right corner of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.
    Edit/Delete Message

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Formula to count names

    Hello jdepriest,

    This is easy to do with CountIf because it supports the use of wild card characters in the criteria. The criteria is not case sensitive so either "Tom" or "tom" will work. This will count all occurances of the letters "tom" in the cell and just whole words.

    =COUNTIF(A1:A5,"*" & "Tom" & "*")
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Registered User
    Join Date
    09-09-2011
    Location
    Waynesburg, Pa
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Formula to count names

    IT WORKED!!!

    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