Vlookup formula that includes searching for specific criteria text within a group of cells

copyboy007

Board Regular
Joined
May 17, 2005
Messages
64
Office Version
  1. 2016
Platform
  1. Windows
Is it possible to get a vlookup result if the specific text string (e.g., ww) is within a column of cells with multiple text strings? For example, how can the AA result show when looking in each row of the first column with multiple strings?

zz, yyAAA
xx, wwBBB
vv, uuCCC
tt, ssDDD
rr, qqEEE
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
A few questions:
What version of Excel do you have?
If we use your example for "ww" won't the answer be "BB"?
Can there be duplicates ("ww" in more than one row)?
 
Upvote 0
Try:
I have made some assumption.
  • ww should return BB
  • There are no duplicates of the search item (ex. ww only shows in one cell in the column).
If this isn't what you want then please answer my questions in the post above.

Book1
ABCDE
1zz, yyAAABB
2xx, wwBBB
3vv, uuCCC
4tt, ssDDD
5rr, qqEEE
Sheet1
Cell Formulas
RangeFormula
E1E1=INDEX($B$1:$B$5,MATCH(TRUE,ISNUMBER(SEARCH(" "&"ww"," "&$A$1:$A$5&" ")),0))
 
Upvote 0
Try:
I have made some assumption.
  • ww should return BB
  • There are no duplicates of the search item (ex. ww only shows in one cell in the column).
If this isn't what you want then please answer my questions in the post above.

Book1
ABCDE
1zz, yyAAABB
2xx, wwBBB
3vv, uuCCC
4tt, ssDDD
5rr, qqEEE
Sheet1
Cell Formulas
RangeFormula
E1E1=INDEX($B$1:$B$5,MATCH(TRUE,ISNUMBER(SEARCH(" "&"ww"," "&$A$1:$A$5&" ")),0))

Thanks for replying. Your assumptions are correct. The sample answer should be BB. I have Excel 2016, but when I duplicate the sample and solution, it's showing a '#N/A' result (value not available error). But, it looks like it should work.
 
Upvote 0
Did you change the ranges to match your actual data?
If so, what is the formula you used and what are the ranges your data is in?
 
Upvote 0
Did you change the ranges to match your actual data?
If so, what is the formula you used and what are the ranges your data is in?

The ranges were updated to match, so I tried repeating the example in this thread using that formula to see if it might be a setting limitation with this work computer's setup.
=INDEX($B$1:$B$5,MATCH(TRUE,ISNUMBER(SEARCH(" "&"ww"," "&$A$1:$A$5&" ")),0))

zz, yyAAA#N/A
xx, wwBBB
vv, uuCCC
tt, ssDDD
rr, qqEEE
 
Upvote 0
I copied your formula into my example and it works.
I don't think it should matter, but what version of Excel are you using?
When you tried to repeat my example did you paste it by clicking on what looks like 2 folders under the f(x) symbol and then pasting in cell A1?

Book1
ABCDE
1zz, yyAAABB
2xx, wwBBB
3vv, uuCCC
4tt, ssDDD
5rr, qqEEE
Sheet1
Cell Formulas
RangeFormula
E1E1=INDEX($B$1:$B$5,MATCH(TRUE,ISNUMBER(SEARCH(" "&"ww"," "&$A$1:$A$5&" ")),0))
 
Upvote 0
Try entering the formula as an array (CTRL+SHIFT+ENTER) as I got #N/A when I tried it at first, but the array entry fixed it.
 
Upvote 0
Glad we could help. Thanks for the feedback.
You should update your profile so we know what version of Excel you are using. As you can see it can make a difference.
 
Upvote 0

Forum statistics

Threads
1,224,819
Messages
6,181,153
Members
453,021
Latest member
Justyna P

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