Search for keywords in a cell and return the adjacent keyword category

gavcol

New Member
Joined
Dec 22, 2016
Messages
19
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi,

I have a similar request to another very old thread which I was going to reply to but the BB advised to create a new post ;)
Search text in a string and return adjacent cell of first value found

My variation to that thread is where I have two tables, a data table and a keyword table.
In the data table I need a formula in the 2nd column (C3) to look in the adjacent cell in the first column (A3) for one of the keywords from the keyword table (Tbl_KeywordCats[Keyword].
Once found, then return the respective category from Col G for that keyword.
I've been able to do a lookup to search for the keyword value but not return the adjacent category. It only returns True/False.

Using similar example from the above thread..........

Find-Keywords-4Cats.xlsb
BCDEFG
1Tbl_DataTbl_KeywordCats
2DataCategoryKeywordCategory
3En John Smith 324334Cat1Paul JonesCat1
4Fr Paul Jones 324246John SmithCat1
5John Smith TE 8564645Joe BloggsCat2
6GT John Smith 845754Jane DoeCat3
7HG Sandra Frey 671182John DoeCat3
8KJ Paul Jones 85662
9
Sheet1


Kinda pulling my hair out with this one and would appreciate any help.
Thanks in advance.
Gav

I have Excel® for Microsoft 365 MSO (Version 2304 Build 16.0.16327.20200) 64-bit
 
Last edited:

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Try the below:

Book1.xlsm
ABCDEFGH
1
2CategoryKeywordCategory
3Paul JonesCat1
4En John Smith 324334Cat1John SmithCat1
5Fr Paul Jones 324246Cat1Joe BloggsCat2
6John Smith TE 8564645Cat1Jane DoeCat3
7GT John Smith 845754Cat1John DoeCat3
8HG Sandra Frey 671182#N/A
9KJ Paul Jones 85662Cat1
10
11
12
Sheet2
Cell Formulas
RangeFormula
C4:C9C4=INDEX($G$3:$G$7,MATCH(1,--ISNUMBER(SEARCH($F$3:$F$7,B4)),0))
 
Upvote 0
Solution
@Skybluekid - Awesome, Thank you !!
Once I converted the static ranges to the table names (and then applied it to the real data set), it worked perfectly ;)
(even after I noticed my sample data hadn't been updated properly to include an example of each category, so here's the finished result (pre real data)


Tbl_DataTbl_KeywordCats
DataCategoryKeywordCategory
En John Smith 324334Cat1Paul JonesCat1
Fr Paul Jones 324246Cat1John SmithCat1
John Smith TE 8564645Cat1Joe BloggsCat2
GT John Smith 845754Cat1Jane DoeCat3
HG Joe Bloggs 671182Cat2John DoeCat3
KJ John Doe 85662Cat3


Cat1


I'm new to the xl2bb addin and haven't figured out the cell formulas bit yet so here's the formula I used
=INDEX(Tbl_TransMapKeyword[Category],MATCH(1,--ISNUMBER(SEARCH(Tbl_TransMapKeyword[Keyword],[@Data])),0))
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
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