Search for a given text from Table range and Return value

MagsinoAS

New Member
Joined
Sep 28, 2011
Messages
20
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
I need help on how to get the result in column B from the table range in column D and E. The PRIORITY is to search for a word/string first from column D from the given value in column A, if the value is not present in the column D search in column E but will return the value in Column D.

Looking at the example below, all the values from cell A2:A6 can be found in column D except for cell A7 which can only be found in Column E.

excel_question.JPG
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
How about
=IFERROR(VLOOKUP(A2,$D$2:$D$6,1,0),IFERROR(INDEX($D$2:$D$6,MATCH(A2,$E$2:$E$3,0)),""))

Please update your account details to show which version of Excel you are using, as this affects which functions you can use.
 
Upvote 0
Thanks for the reply. Here is the result I got after following the formula given. I think this will not work since the vlookup will get the exact match from column D. Let say for cell A2 (Halswell Christchurch), the value in Column D is only Halswell.

excel_question2.JPG


What I got so far is using the formula {=IFERROR(INDEX($D$2:$D$7,MATCH(TRUE,ISNUMBER(SEARCH($D$2:$D$7,A2)),0)),"")}
However, this only work for the first part, I need to get the desired result for cell A7 which can only be found in Column E.

excel_question3.JPG
 

Attachments

  • excel_question3.JPG
    excel_question3.JPG
    79 KB · Views: 2
Upvote 0
In that case can you please post your sample data to the board using the XL2BB add-in. Images are not much use.
 
Upvote 0
Here it is...

SL Birthday Form.xlsx
ABCDE
1StoreDesired ResultStoreStore Address
2Halswell ChristchurchHalswell Halswell344 Halswell Road Halswell Christchurch New Zealand
3goreGoreGoreGore225 Main South Road Gore Gore New Zealand
4Barrington MallBarringtonBarringtonBarringtonShop 72 256 Barrington Street Barrington Mall Spreydon Christchurch New Zealand
5WhangaparaoaWhangaparaoaWhangaparaoaWhangaparaoaB8 570 Whangaparaoa Road Stanmore Bay Whangaparaoa New Zealand
6Lunn Ave, Mt. Wellington, AucklandLunn AveLunn AveLunn Ave430c Ellerslie Panmure Highway Mt Wellington Auckland New Zealand
7InvercargillCollingwood Collingwood44 North Road Waikiwi Invercargill New Zealand
Sheet2
Cell Formulas
RangeFormula
C2C2=IFERROR(INDEX($D$2:$D$7,MATCH(TRUE,ISNUMBER(SEARCH($D$2:$D$7,A2)),0)),"")
C3:C7C3=IFERROR(INDEX($D$2:$D$7,MATCH(TRUE,ISNUMBER(SEARCH($D$2:$D$7,A3)),0)),"")
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Thanks for that, how about
=IFERROR(INDEX($D$2:$D$7,MATCH(TRUE,ISNUMBER(SEARCH($D$2:$D$7,A2)),0)),IFERROR(INDEX($D$2:$D$7,MATCH(TRUE,ISNUMBER(SEARCH(A2,$E$2:$E$7)),0)),""))
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,276
Members
449,075
Latest member
staticfluids

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