Lookup up value from list

2077delta

Active Member
Joined
Feb 17, 2002
Messages
252
Office Version
  1. 365
Platform
  1. Windows
I have a two column table with column one (Search Value) have a unique list of names and column two (Return Value) having a return value for each of those names. I would like to know if there is a formula that can look at a cell containing text, and if one of the unique names in column one of my table is contained within the text of that cell, will then it will return the associated value in column two. The cell will never contain more than one item listed in column one of my table.

1697645706857.png
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
try
=INDEX($B$2:$B$101,MATCH(1,COUNTIF(G2,"*"&A$2:$A$101&"*"),0))

Book13
ABCDEFGH
1
2fred1athis is fred and his 1a
3harry2a
4john3a
5sally4
6sue5
Sheet1
Cell Formulas
RangeFormula
H2H2=INDEX($B$2:$B$101,MATCH(1,COUNTIF(G2,"*"&A$2:$A$101&"*"),0))


i have not copied all your data into example

Note: Images are difficult to see , and also requires that I input all the data myself, which means I may make an error, which is very time consuming, and from my point of view less likely to get a response, if a complicated spreadsheet. Plus we cannot see any of the formulas used.

Therefore -

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

This will possibly enable a quicker and more accurate solution for you.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC

then put the sample spreadsheet onto a share

I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed

Make sure you set any share or google to share to everyone
 
Upvote 0
try
=INDEX($B$2:$B$101,MATCH(1,COUNTIF(G2,"*"&A$2:$A$101&"*"),0))

Book13
ABCDEFGH
1
2fred1athis is fred and his 1a
3harry2a
4john3a
5sally4
6sue5
Sheet1
Cell Formulas
RangeFormula
H2H2=INDEX($B$2:$B$101,MATCH(1,COUNTIF(G2,"*"&A$2:$A$101&"*"),0))


i have not copied all your data into example

Note: Images are difficult to see , and also requires that I input all the data myself, which means I may make an error, which is very time consuming, and from my point of view less likely to get a response, if a complicated spreadsheet. Plus we cannot see any of the formulas used.

Therefore -

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

This will possibly enable a quicker and more accurate solution for you.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC

then put the sample spreadsheet onto a share

I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed

Make sure you set any share or google to share to everyone
That worked, and it is so simple. Thank you!
 
Upvote 0
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Since you appear to have a formal Excel table to lookup in, you can use table nomenclature so the the search and return ranges automatically expand/contract with the table. That saves having to either change the ranges if the lookup table gets bigger or deciding how big the ranges need to be to be sure to always be big enough.
In cell I2 below I have adapted @etaf's formula to that table nomenclature in case you are interested in doing it that way.

In cell H2 I have offered an alternative that may be of interest if your Excel version (refer my first paragraph above) that has the FILTER function.

2077delta.xlsm
ABCGHI
1SearchReturn
2fred1athis is fred and his 1a1a
3harry2a
4john3a
5sally4
6sue5
7
8
Sheet1
Cell Formulas
RangeFormula
H2H2=FILTER(Table1[Return],ISNUMBER(SEARCH(Table1[Search],G2)),"")
I2I2=INDEX(Table1[Return],MATCH(1,COUNTIF(G2,"*"&Table1[Search]&"*"),0))
 
Upvote 0

Forum statistics

Threads
1,215,073
Messages
6,122,976
Members
449,095
Latest member
Mr Hughes

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top