+ Reply to Thread
Results 1 to 5 of 5

Checking cells for 2 text strings

  1. #1
    Forum Contributor
    Join Date
    06-10-2005
    MS-Off Ver
    2007
    Posts
    223

    Checking cells for 2 text strings

    Hi,
    I have a large column of cells with varying text lengths and I need to check each cell to see if it has the text "Joe Smith" and "Golf Clubs". Basically I want to count how many instances of that combination exists in the entire column.
    Any help would be appreciated.
    Thanks,
    Phillycheese
    Last edited by Phillycheese5; 10-04-2010 at 10:25 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Checking cells for 2 text strings

    To count instances of the combination of those in one cell...

    =SUMPRODUCT(--ISNUMBER(SEARCH("Joe Smith",A1:A100)),--ISNUMBER(SEARCH("Golf Clubs",A1:A100)))

    in Xl2007 or later

    =COUNTIFS(A1:A100,"*Joe Smith*",A1:A100,"*golf clubs*")
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Checking cells for 2 text strings

    Hi,

    How about this:

    =SUMPRODUCT((ISNUMBER(FIND("Joe Smith",A1:A10))*(ISNUMBER(FIND("Golf Clubs",A1:A10)))))
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  4. #4
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Checking cells for 2 text strings

    or more succinctly

    =SUMPRODUCT(1*(ISNUMBER(FIND("Joe Smith",A1:A10)+FIND("Golf Clubs",A1:A10))))

  5. #5
    Forum Contributor
    Join Date
    06-10-2005
    MS-Off Ver
    2007
    Posts
    223

    Re: Checking cells for 2 text strings

    Thank you...works great.

+ 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