Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to get first record from lookup table that is a substring of some value?

In MS-EXCEL, how can I achieve something like below:

Given:
sheet1 - raw-info ('james brown england', 'tommy australia 1234', 'saka ireland', 'denmark martin')
sheet2 - countries (england, nigeria, usa, denmark, australia)

after applying some formula, I want a new column in sheet1 that will have the following values:

sheet1 with two columns:
raw-info ('james brown england', 'tommy australia 1234', 'saka ireland', 'denmark martin')
new-col (england, australia, **blank**, denmark)

logic is:
if raw-info column value contains any value in countries column as a substring, use the matching value from countries column, else leave it blank.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

In B2(assuming you have headers):

=INDEX('Sheet2'!A:A,AGGREGATE(15,7,ROW('Sheet2'!$A$1:$A$6)/(ISNUMBER(SEARCH('Sheet2'!$A$1:$A$6,B2))),1))
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading