+ Reply to Thread
Results 1 to 9 of 9

Given If any words in column A match any string of text in column B, return column B

  1. #1
    Registered User
    Join Date
    10-28-2022
    Location
    US
    MS-Off Ver
    2016
    Posts
    2

    Given If any words in column A match any string of text in column B, return column B

    I need help with this issue, I have two columns, A & B. Colum A has strings of text like "cat apple tree", column B has one or two strings of text like " cat" or "cat tree". I am having trouble creating a formula where it checks, lets say A1 where the value of A1 is "cat apple tree" and compares to the entirety of column B. After it compares the cell from column A to the entirety of column B where lets say B12 = cat, then it will return the cell value of column B where the text matched. Column A has multiple words so if any match any of column B, I need the cell value of B to be returned. I know that sounds confusing work sheet is attached.Practice.xlsx

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: Given If any words in column A match any string of text in column B, return column B

    Welcome to the forum.

    Try this:

    =IFERROR(LOOKUP(99999,SEARCH(B$1:B$4,A1),B$1:B$4),"")
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    10-28-2022
    Location
    US
    MS-Off Ver
    2016
    Posts
    2

    Re: Given If any words in column A match any string of text in column B, return column B

    Unfortunately this did not work. it is giving me 0 value for a string that should match to a value

  4. #4
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,419

    Re: Given If any words in column A match any string of text in column B, return column B

    Please try in C1 and copy down (confirm the formula with CTRL+SHIFT+ENTER):
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by HansDouwe; 10-28-2022 at 05:36 PM.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: Given If any words in column A match any string of text in column B, return column B

    It does work.
    Attached Files Attached Files

  6. #6
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Given If any words in column A match any string of text in column B, return column B

    my 3 cents with Power Query

    Column1 Column1 Custom Custom.1
    cat tree apple house earth venus mars moon venus
    dog blue kid cat Post a small Excel sheet not picture showing realistic & representative sample data picture & data
    plant tree house fly house tree plant house
    red orange venus bird owl fly fly
    yellow fish mom and cat tree apple cat
    crazy dog jumping & barking data List.Generate() and Looping in PowerQuery and
    bird owl fly picture crazy dog jumping & barking &
    screen mouse & dog blue kid
    table chair lamp yellow fish mom
    earth venus mars moon red orange
    List.Generate() and Looping in PowerQuery screen mouse
     Post a small Excel sheet not a picture showing realistic & representative sample data  table chair lamp


    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by sandy666; 10-28-2022 at 06:24 PM. Reason: file updated

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: Given If any words in column A match any string of text in column B, return column B

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank those who have helped you by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: Given If any words in column A match any string of text in column B, return column B

    Thanks for the rep and for confirming that the formula I suggested does work.

  9. #9
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,419

    Re: Given If any words in column A match any string of text in column B, return column B

    You are welcome, thanks for the rep with feedback .

+ 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] Vlookup name in column 1 and text string in column 2 and bring that cell in column 2
    By luajambeiro in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-22-2019, 06:12 PM
  2. Replies: 4
    Last Post: 08-23-2017, 08:11 AM
  3. [SOLVED] Search Text String for Match in a Column of Key Words
    By letsgobuffalo in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-29-2017, 06:04 AM
  4. [SOLVED] To Find if a text string contains key words in column B and C and set to value in column D
    By alice2011 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-27-2015, 11:42 AM
  5. [SOLVED] Search Column A and B for string match and return value of column C
    By RichTea88 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-18-2013, 10:02 AM
  6. match string in column with array of words
    By bkdimri in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-16-2013, 04:28 AM
  7. [SOLVED] Simple formula to match column A, sheet1, with column A, sheet2, return text answer
    By Connie5761 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 11-14-2012, 02:56 PM

Tags for this Thread

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