+ Reply to Thread
Results 1 to 7 of 7

2 cell text lookup in text string to return data from separate column

  1. #1
    Registered User
    Join Date
    02-07-2019
    Location
    New York
    MS-Off Ver
    Office 365
    Posts
    21

    2 cell text lookup in text string to return data from separate column

    Hi guys,
    need help in finding a formula that can do this:
    Table 1--> "Tags" (column C in Catalog sheet) needs to be populated from "Tags" (column C in 'Tags' sheet) when:
    Text in Type (column B in Catalog sheet) matches text in Type (column A in 'Tags' sheet)
    And
    Text in Title (column B in 'Tags' sheet) exists in the Text string of Title (column A in Catalog sheet).

    (Sample data in the attached .xlsx)


    I tried all sorts of solutions but they all failed (VLookup with helper column, Match, Lookup, Search) but wasn't able to solve it by myself. (Match worked but Only when the match didn't need to 'look' inside a text string, I tried to combine it with Search but that failed).

    Hoping you guys can help me out.

    thanks,
    Ziv
    Attached Files Attached Files
    Last edited by Zivhodiva; 02-08-2019 at 03:04 PM.

  2. #2
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,371

    Re: 2 cell text lookup in text string to return data from separate column

    Maybe, put this on C2 on sheet "Catalog" and copied down:

    =IFERROR(IFERROR(LOOKUP(1000,SEARCH(SUBSTITUTE(Tags!$A$2:$A$8," ","*"),B2),Tags!$A$2:$A$8),LOOKUP(1000,SEARCH(LEFT(Tags!$A$2:$A$8,FIND(" ",Tags!$A$2:$A$8&" ")-1),B2),Tags!$A$2:$A$8)),"")
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    02-07-2019
    Location
    New York
    MS-Off Ver
    Office 365
    Posts
    21

    Re: 2 cell text lookup in text string to return data from separate column

    Thanks azumi,
    the formula you provided doesn't do it (or needs some tweaking)
    it returns values but not from column C of Tags sheet (not sure form where it retrieves the info)
    attached what i got when i used it:


    Screen Shot 2019-02-07 at 21.01.31.jpg

  4. #4
    Registered User
    Join Date
    02-07-2019
    Location
    New York
    MS-Off Ver
    Office 365
    Posts
    21

    Re: 2 cell text lookup in text string to return data from separate column

    I played around with your formula, trying to get returned values from column C Tags sheet,

    =IFERROR(IFERROR(LOOKUP(1000,SEARCH(SUBSTITUTE(Tags!$A$2:$A$8," ","*"),B4),Tags!$C$2:$C$8),LOOKUP(1000,SEARCH(LEFT(Tags!$A$2:$A$8,FIND(" ",Tags!$A$2:$A$8&" ")-1),B4),Tags!$A$2:$A$8)),"")

    I was able to get returned values from column C Tags sheet but it seems it only checks against data from the "Type" columns, ignoring the 2nd criteria of validating that the text string in Title column has the text in Title column Tags sheet.

  5. #5
    Registered User
    Join Date
    02-07-2019
    Location
    New York
    MS-Off Ver
    Office 365
    Posts
    21

    Re: 2 cell text lookup in text string to return data from separate column

    To clarify,
    there's only 1 line in the sample file that matches both criteria:
    Has a match in the Type column AND the text string in Title column includes the text in Title column Tags sheet.
    all other lines should remain empty or display error.

    something like this (which i created manually)

    Screen Shot 2019-02-07 at 21.18.52.jpg

  6. #6
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: 2 cell text lookup in text string to return data from separate column

    Please try at C2 and drag down

    =IFERROR(LOOKUP(1,1/(B2=Tags!$A$2:$A$8)/ISNUMBER(SEARCH(Tags!$B$2:$B$8,A2)),Tags!$C$2:$C$8),"")

  7. #7
    Registered User
    Join Date
    02-07-2019
    Location
    New York
    MS-Off Ver
    Office 365
    Posts
    21

    Thumbs up Re: 2 cell text lookup in text string to return data from separate column

    Bo_Ry my man !
    your formula works perfectly :-)
    it is the last part of a larger formula. after putting the part you provided it highlighted a different problem in the "main" formula that i didn't notice before.

    this is the full formula:

    IF(ISNA(VLOOKUP(E2,Tags!$G$1:$J$33,4,FALSE)),IF(ISNA(VLOOKUP(D2,Tags!$D$1:$E$13,2,FALSE)),VLOOKUP(E2,Tags!$A$2:$B$106,2,FALSE),VLOOKUP(D2,Tags!$D$1:$E$13,2,FALSE)),IF(ISTEXT(VLOOKUP(D2,Tags!$D$1:$E$13,2,FALSE)),VLOOKUP(D2,Tags!$D$1:$E$13,2,FALSE),IF(ISNA(LOOKUP(2^15,SEARCH(Tags!$H$2:$H$33,B2))),VLOOKUP(E2,Tags!$A$2:$B$106,2,FALSE),IFERROR(LOOKUP(1,1/(E2=Tags!$G$2:$G$33)/ISNUMBER(SEARCH(Tags!$H$2:$H$33,B2)),Tags!$J$2:$J$33),""))))&D2

    The part highlighted in red is the part was not working as I need it to.
    Its supposed to check for the existence of a word (from Tags!$H$2:$H$3) in the text string of B2,and it does that.
    But, I need it to check for a "double" match (to confirm that the there's a match for column G and than that there's a match for column H of Tags sheet.

    to solve it is used Bo_Ry (thanks again man) to replace my old Lookup formula.
    it even made the entire formula shorter.

    here is the full, new, working formula.

    =IF(ISNA(VLOOKUP(E2,Tags!$G$1:$J$33,4,FALSE)),IF(ISNA(VLOOKUP(D2,Tags!$D$1:$E$13,2,FALSE)),VLOOKUP(E2,Tags!$A$2:$B$106,2,FALSE),VLOOKUP(D2,Tags!$D$1:$E$13,2,FALSE)),IF(ISTEXT(VLOOKUP(D2,Tags!$D$1:$E$13,2,FALSE)),VLOOKUP(D2,Tags!$D$1:$E$13,2,FALSE),IFERROR(LOOKUP(1,1/(E2=Tags!$G$2:$G$33)/ISNUMBER(SEARCH(Tags!$H$2:$H$33,B2)),Tags!$J$2:$J$33),VLOOKUP(E2,Tags!$A$2:$B$106,2,FALSE))))&D2

+ 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 for a text string and return given text string to adjacent cell
    By hecgroups in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-14-2015, 04:50 AM
  2. Replies: 1
    Last Post: 10-17-2014, 09:13 AM
  3. [SOLVED] Find partial text string within another text string return original text into cell.
    By mikey42979 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-17-2013, 02:58 PM
  4. Separate numbers embed in a text string into a new column or cell
    By DennyT48 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-23-2012, 04:14 PM
  5. [SOLVED] Find Specific Text in Text String and Return Value in Adjacent Column
    By watchouse in forum Excel General
    Replies: 2
    Last Post: 07-11-2012, 03:53 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