Help with nested isnumber(search) in IF and multiple hits

maximillianrg

Board Regular
Joined
Aug 7, 2014
Messages
75
Office Version
  1. 2016
Platform
  1. Windows
Hello Excel Masters
  • I have a 9,000 row excel sheet that contains an export of a directory structure
  • The below formula searches F2 for 1 of 8 key words and if it finds it, it returns the value of that keyword in cell B2 and if it does not find the value it returns False
  • The Keywords are: response, resp, narrative, request, production, letter, exhibits, annex, rfi,

=if(ISNUMBER(SEARCH("response",F2)),"response",if(ISNUMBER(SEARCH("resp",F2)),"resp",if(ISNUMBER(SEARCH("narrative",F2)),"narrative",if(ISNUMBER(SEARCH("request",F2)),"request",if(ISNUMBER(SEARCH("production",F2)),"production",if(ISNUMBER(SEARCH("letter",F2)),"letter",if(ISNUMBER(SEARCH("exhibits",F2)),"exhibits",if(ISNUMBER(SEARCH("annex",F2)),"annex",if(ISNUMBER(SEARCH("rfi",F2)),"rfi",if(ISNUMBER(SEARCH("RFI",F2)),"Other"))))))))))


This works great if cell F2 contains 0 or 1 of the keywords but if multiple keywords exist in cell 2 then I need to find a way to return the last keyword in the cell the formula finds.

Example If F2 = C:\Regulatory\Asia\Athens\Response\Submitted\Exhibits\Annex\Approved
The formula would need to return "annex" and not Exhibits or Response
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Let's try this.

MrExcel posts19.xlsx
BCDEF
1
2C:\Regulatory\Asia\Athens\Response\Submitted\Exhibits\Annex\Approved
3
4Excel365ye Olde Excel
5annexannex
6
7keywords
8response
9resp
10narrative
11request
12production
13letter
14exhibits
15annex
16rfi
Sheet24
Cell Formulas
RangeFormula
D5D5=XLOOKUP(LEN(F2),IFERROR(SEARCH(B8:B16,F2),0),B8:B16,,-1)
E5E5=LOOKUP(MAX(IFERROR(SEARCH(B8:B16,F2),0)),IFERROR(SEARCH(B8:B16,F2),0),B8:B16)
 
Upvote 0
Solution
Thank you so much DrSteel for the above answers. It worked perfectly and I ended up using the formula in cell E5
 
Upvote 0

Forum statistics

Threads
1,224,798
Messages
6,181,038
Members
453,014
Latest member
Chris258

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