Search code examples
excelexcel-formulavlookup

Excel find text if contained in lookup table


i have following table

enter image description here

I need an Excel formula in column A for all values in column B. the formula should look for all values in column 'lookup table' one by one and find if the value (for example 'aaa') is contained column 'lookup value'. for example in this case (aaa) it is in B2 and B6. The following should be the result

enter image description here

will appreciate your help. i looked for vlookup and but normally the formula is used for value in column C. in my case i need for column B.

best regards rnv


Solution

  • Using ISNUMBER(MATCH()):

    =IF(OR(ISNUMBER(MATCH("*"&$C$2:$C$4&"*",B2,0))),"x","")
    

    enter image description here

    Using ISNUMBER(SEARCH())

    =IF(OR(ISNUMBER(SEARCH($C$2:$C$4,B2))),"x","")
    

    enter image description here

    With Office 365 Dynamic BYROW, we can spill:

    =BYROW(B2:B6,LAMBDA(a,IF(OR(ISNUMBER(SEARCH($C$2:$C$4,a))),"x","")))
    

    enter image description here