+ Reply to Thread
Results 1 to 11 of 11

Search Text from List (multiple columns) and check if List words appears in String

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    04-13-2011
    Location
    Ottawa, Canada
    MS-Off Ver
    365
    Posts
    1,115

    Search Text from List (multiple columns) and check if List words appears in String

    Given that I have a list of names (Table1 - all of the columns),

    And that I have a free style text field (cell G2:G3).

    I'd like to return [cust Name] when the list (cust Name to cust#4), is found in the string.

    i.e. in cell G2, notice that 'Adam' (in cell C4) was found in, thus return 'First Adam'.

    i.e. in cell G4, notice that 'Mary' (cell B3), 'Jane' (cell C3) and 'JANE, MARY' (cell E4) is found in the text as jane, mary (cell G2). Thus returning 'Mary Jane'

    Return Value when string contains values from List.png
    Last edited by dluhut; 08-30-2022 at 02:58 PM.

  2. #2
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    MA, USA
    MS-Off Ver
    365(PC) V:2412
    Posts
    1,477

    Re: Search Text from List (multiple columns) and check if List words appears in String

    In H2 try:

    Formula: copy to clipboard
    =IF($G2="","",INDEX(Table1,ROUNDUP(MIN(IF(ISERR(SEARCH(Table1,$G2)),"",SEQUENCE(ROWS(Table1),COLUMNS(Table1),1,1)))/COLUMNS(Table1),0),1))
    <----- If you are happy with your solution please click on the "* Add Reputation" as a way to say thank you.

  3. #3
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,505

    Re: Search Text from List (multiple columns) and check if List words appears in String

    Here one way

    =FILTER(Table1[cust Name],SIGN(MMULT(IFERROR(SEARCH(Table1,G2),0),SEQUENCE(COLUMNS(Table1)))))
    Last edited by JEC.; 08-30-2022 at 03:27 PM.

  4. #4
    Valued Forum Contributor
    Join Date
    04-13-2011
    Location
    Ottawa, Canada
    MS-Off Ver
    365
    Posts
    1,115

    Re: Search Text from List (multiple columns) and check if List words appears in String

    @dosydos I tried putting your formula onto my sample and works. However, when I put it in my real live data, it doesn't,

    I've attached a workbook.

    Note that the table is in a different sheet, and the lookup value is on another sheet.

    What did I do wrong here?

  5. #5
    Valued Forum Contributor
    Join Date
    04-13-2011
    Location
    Ottawa, Canada
    MS-Off Ver
    365
    Posts
    1,115

    Re: Search Text from List (multiple columns) and check if List words appears in String

    @JEC. it gave me a NAME error. Seems like I don't have one of the functions.

    Anyway, I saw that you've edited the formula, and I tried, however, it gave me all of the names that's in the table tblContract[Contractor Name].

    Please see above post with the new workbook of a real live data

  6. #6
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,505

    Re: Search Text from List (multiple columns) and check if List words appears in String

    I forgot some translation. I changed my previous post

  7. #7
    Valued Forum Contributor
    Join Date
    04-13-2011
    Location
    Ottawa, Canada
    MS-Off Ver
    365
    Posts
    1,115

    Re: Search Text from List (multiple columns) and check if List words appears in String

    So I realized is because I have an more columns in the table where it's all blank values (it's acting as a placeholder).

    So when I added 1 more column to the table in my original dummy workbook, it's not giving the correct result either.

    How do I overcome it?

  8. #8
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    MA, USA
    MS-Off Ver
    365(PC) V:2412
    Posts
    1,477

    Re: Search Text from List (multiple columns) and check if List words appears in String

    ok here is a new one taking into consideration the blanks in your table:

    Formula: copy to clipboard
    =LET(FUN,IF(ISBLANK(tblContract),"|$|",tblContract),IF($A1="","",INDEX(tblContract,ROUNDUP(MIN(IF(ISERR(SEARCH(FUN,$A1)),"",SEQUENCE(ROWS(tblContract),COLUMNS(tblContract),1,1)))/COLUMNS(tblContract),0),1)))

  9. #9
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,505

    Re: Search Text from List (multiple columns) and check if List words appears in String

    This one too

    =FILTER(tblContract[Contractor Name],SIGN(MMULT(IFERROR(SEARCH(tblContract,A1)*(tblContract<>""),0),SEQUENCE(COLUMNS(tblContract)))))

  10. #10
    Valued Forum Contributor
    Join Date
    04-13-2011
    Location
    Ottawa, Canada
    MS-Off Ver
    365
    Posts
    1,115

    Re: Search Text from List (multiple columns) and check if List words appears in String

    Solved by 2 of you and reps up to both of you

  11. #11
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    MA, USA
    MS-Off Ver
    365(PC) V:2412
    Posts
    1,477

    Re: Search Text from List (multiple columns) and check if List words appears in String

    Glad they work and thanks for the rep

+ 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. Help with search for all words in a list of text
    By rehanov in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-13-2020, 11:18 PM
  2. [SOLVED] Number of times a word appears in text string against a fixed list
    By Dan_B in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-10-2019, 09:56 AM
  3. Search a string to see if any words in list are found in string
    By nphadro in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-07-2018, 12:55 PM
  4. [SOLVED] Search cell to see if it contains text from a list of words
    By amurray2307 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-08-2013, 05:41 AM
  5. Replies: 1
    Last Post: 04-04-2012, 07:15 PM
  6. How do I do a multiple search using key words in a text string
    By patricia tipp in forum Excel General
    Replies: 1
    Last Post: 02-28-2006, 01:10 PM
  7. [SOLVED] Process a row if a string search finds certain words from a list
    By Reuel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-26-2005, 10:02 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