• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

If a Cell Contains a Certain Text (From Another Table)

Bassem

New Member
I have a very challenging exercise that I want to solve and of course with your help.

My Excel workbook contains two sheets.

Sheet 1 is my main sheet.
The cells in the first column (A) contain all the different codes.
And I am trying to check if this cell contains specific text.
In my example, the codes I am trying to search are listed in sheet 2. (e.g. 736, 739, H01, H05)

Meaning: If a Cell (A2) Contains a Certain Text (e.g. 736 or H05 ...etc.), then Put in cell B2 a Specified Text (Specific Code Name listed in the second sheet)
e39e273654eb7915c6f363d627bd24fc.png


Sheet 2 contains the table of these codes (source)
330188cf31f0705713195b00b9894e42.png


And this is the final result that I am trying to achieve.
629b898f4fe42db8ba1ede5a4a5f0700.png



Would you please help me with which formula I shall use.
the sample excel sheet is attached as well.

Thank you in advance.
 

Attachments

  • codes.xlsx
    11.7 KB · Views: 2
B2, copy down :

=IFERROR(LOOKUP(1,-SEARCH(" "&Table1[Specific Code]&" "," "&[@[All Codes]]&" "),Table1[Specific Code Name]),"")

Regards

GREAAAAT!!!! Thanks a lot bosco_yip, it works :)

One last question, what if the (All Codes) format comes with commas as shown in the attached pic, what will be the formula in this case?

sorry for annoying.

d0906711cf2f11f884edbfffe0320b88.png
 

Attachments

  • codes(2).xlsx
    12.3 KB · Views: 4
Back
Top