+ Reply to Thread
Results 1 to 9 of 9

Search for a set of different strings in a cell & output in one cell

  1. #1
    Registered User
    Join Date
    04-20-2018
    Location
    Berlin
    MS-Off Ver
    Latest
    Posts
    5

    Search for a set of different strings in a cell & output in one cell

    Hi everyone,

    I am facing a tough one. I have a list (table) with "blacklisted" words in my excel file. I want to search one cell, which is a very long string joined together, for ANY of those words. In case ONE of those words is included in that string, I want a TRUE BOOLEAN statement, else FALSE.

    I attached an example excel file. The yellow cell should output a TRUE or FALSE.

    It sounds quite simple, yet I am not able to wrap my head around it. Your help is highly appreciated.

    Cheers
    Attached Files Attached Files

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,459

    Re: Search for a set of different strings in a cell & output in one cell

    Try in B2:

    =OR(ISNUMBER(SEARCH($A$2:$A$4,C2)))
    Quang PT

  3. #3
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Search for a set of different strings in a cell & output in one cell

    Or:

    =IF((ISERROR(LOOKUP(1E+100,SEARCH(BlacklistAnchors!$A$2:$A$88,C2),BlacklistAnchors!$A$2:$A$88))),"FALSE","TRUE")

  4. #4
    Registered User
    Join Date
    04-20-2018
    Location
    Berlin
    MS-Off Ver
    Latest
    Posts
    5

    Re: Search for a set of different strings in a cell & output in one cell

    Quote Originally Posted by bebo021999 View Post
    Try in B2:

    =OR(ISNUMBER(SEARCH($A$2:$A$4,C2)))
    This is not working for me. It always returns FALSE.

    Also I am looking to check the "BlacklistAnchors" sheet (second one).

  5. #5
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Search for a set of different strings in a cell & output in one cell

    THe formula in #3 post should do the trick

  6. #6
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,899

    Re: Search for a set of different strings in a cell & output in one cell

    Or try:

    =SUMPRODUCT(COUNTIF(C2,"*"&Table7[Blacklist Anchors]&"*"))>0

  7. #7
    Registered User
    Join Date
    04-20-2018
    Location
    Berlin
    MS-Off Ver
    Latest
    Posts
    5

    Re: Search for a set of different strings in a cell & output in one cell

    Quote Originally Posted by PaulM100 View Post
    Or:

    =IF((ISERROR(LOOKUP(1E+100,SEARCH(BlacklistAnchors!$A$2:$A$88,C2),BlacklistAnchors!$A$2:$A$88))),"FALSE","TRUE")
    This one works like a charm. Thank you so much! However, I am not quite sure if I understand why or how it works !

  8. #8
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Search for a set of different strings in a cell & output in one cell

    Here is an explanation on the Lookup part:http://www.excelforum.com/excel-form...-a-lookup.html
    The IF+ISERROR will return the FALSE if no word is found in string and TRUE if one of them is found.

  9. #9
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Search for a set of different strings in a cell & output in one cell

    Another way.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

+ 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. [SOLVED] Search cell for any of a number of strings and return the associated value from the Key
    By Tambien in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-09-2017, 01:55 PM
  2. Replies: 7
    Last Post: 12-18-2013, 06:34 AM
  3. Search cell text and output different values based on result in another cell
    By tbarn1980 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-14-2013, 09:54 PM
  4. Replies: 5
    Last Post: 03-29-2012, 04:12 AM
  5. Search multiple strings in a cell using the OR function?
    By accelerator in forum Excel General
    Replies: 6
    Last Post: 01-16-2010, 04:39 AM
  6. Replies: 2
    Last Post: 12-18-2009, 10:59 AM
  7. How do I search Strings and get an output?
    By dziw in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-09-2007, 02:26 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