search for a string in cell having multiple string

sandhya16

New Member
Joined
Jun 8, 2015
Messages
34
i am looking for a code to search for a single cell value in multiple cell value and return the adjacent cell for eg-


in sheet 1-
A B
4F876




Sheet 2-


A B


4F876 4M4646 5GAR 100




Column B in sheet 1 should return 100 value.


Please help.
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
VLOOKUP accepts wild card

=VLOOKUP("*cat*", A1:B20, 2, FALSE)

will return the value from column B1:B20 of the first cell in A1:A20 that contains the sub-string "cat"

e.g. "4 cats and 8 dogs"

Note that it will also find "catalog"
 
Upvote 0
I am looking for a general formula because columnA of sheet 1 can have any value and match it in columnA of Sheet 2 having multiple strings but one of those string should match the columnA of Sheet1.
 
Upvote 0
Sheet-1


ColumnA ColumnB
4RAT
4SYU






Sheet -2


ColumnA ColumnB
4SYTA 4RAT 4MAY 5SAT 100
4MAI 6STA 4SYU 5SYT 200
 
Upvote 0
Will your lookup values always be surrounded by a space in the strings they're being looked for in?

Matty
 
Upvote 0
In Sheet1, try:

Code:
=LOOKUP(9.99999999999999E+307,SEARCH(" "&A2&" "," "&Sheet2!A$2:A$11&" "),Sheet2!B$2:B$11)

Where the lookup value resides in A2.

Matty
 
Upvote 0
can you please show me with the results for this formula its not clear to me

Code:
=LOOKUP(9.99999999999999E+307,SEARCH(" "&A2&" "," "&Sheet2!A$2:A$11&" "),Sheet2!B$2:B$11)
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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