Search text and categorise each description

jonnyrobert

New Member
Joined
Feb 12, 2015
Messages
4
Hi, had a good look but could not find an exact answer...

I am looking to categorise each text description into 1 of say 10 categories. I need to assign multiple words to equal each particular category, if 1 or more of those words occur then the category that they correspond to will be displayed in the final column.

I have found several posts relating to text search resulting in true/false result but how do I get a result where it shows which category the description falls into?

Key example:

Text Category
spreaderspreader
twinspreader
framespreader
controlcontrol
panelcontrol
powercontrol
gantrygantry
(A)Assist
AssistAssist

<COLGROUP><COL style="WIDTH: 48pt" span=2 width=64><TBODY>
</TBODY>

Thanks!!!

Raw data comes in as below

Work OrderDescriptionHaslogEngineerLocationAssetStatusReported DatePriorityOwner GroupParent WOOut of ServiceKnown Cost
2364905QC17 TTY LOST spreaderY8952TTYQC17J3900CLOSE30/11/14 05:01PFLFSQUDN8.71
2364210QC17 TTY NO UNDERCAB FLOODLIGHTS spreaderY7183TTYQC17J3900CLOSE30/11/14 02:26PFLFSQUDN279.37
2364101Liebherr Remedials - PLC Mounts broken (A)N8972TTYQC17J3900CLOSE29/11/14 10:34PFLFSQUDN0
2364100Liebherr Remedials - Hoist Drive Fans U/S ~ Replace (A)N8972TTYQC17J3900CLOSE29/11/14 10:33PFLFSQUDN0
2364099Liebherr Remedials - Hoist Drive Fans U/S ~ Replace gantryY8972TTYQC17J3900CLOSE29/11/14 10:32PFLFSQUDN0
2364098Liebherr Remedials - PLC Mounts brokenY7979TTYQC17J3900CLOSE29/11/14 10:31PFLFSQUDN10.32

<COLGROUP><COL style="WIDTH: 54pt; mso-width-source: userset; mso-width-alt: 2633" width=72><COL style="WIDTH: 218pt; mso-width-source: userset; mso-width-alt: 10642" width=291><COL style="WIDTH: 45pt; mso-width-source: userset; mso-width-alt: 2194" width=60><COL style="WIDTH: 41pt; mso-width-source: userset; mso-width-alt: 2011" width=55><COL style="WIDTH: 44pt; mso-width-source: userset; mso-width-alt: 2121" width=58><COL style="WIDTH: 31pt; mso-width-source: userset; mso-width-alt: 1499" width=41><COL style="WIDTH: 34pt; mso-width-source: userset; mso-width-alt: 1645" width=45><COL style="WIDTH: 82pt; mso-width-source: userset; mso-width-alt: 3986" width=109><COL style="WIDTH: 20pt; mso-width-source: userset; mso-width-alt: 950" width=26><COL style="WIDTH: 60pt; mso-width-source: userset; mso-width-alt: 2925" width=80><COL style="WIDTH: 57pt; mso-width-source: userset; mso-width-alt: 2779" width=76><COL style="WIDTH: 44pt; mso-width-source: userset; mso-width-alt: 2121" width=58><COL style="WIDTH: 56pt; mso-width-source: userset; mso-width-alt: 2706" width=74><TBODY>
</TBODY>
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
So in your example the results would be

spreader
spreader
Assist
Assist
gantry
NA
 
Upvote 0
Let A1:B10 of a sheet called Admin house Text to Category associations. Let's name A2:A10 as KeyWords and B2:B10 as Categories.

Let A:M of Sheet1 house the data you want to categorize.

In N2 of Sheet1 enter and copy down:

=IFERROR(LOOKUP(9.99999999999999E+307,SEARCH(" "&KeyWords&" "," "&$B2&" "),Categories)
 
Upvote 0
=IFERROR(LOOKUP(9.99999999999999E+307,SEARCH(" "&KeyWords&" "," "&$B2&" ")),Categories)

I added the bracket highlighted red for excel to accept the formula....

Im sure its close but my results just return #Name?

How does the formula know to look in Admin?
Does this need to be entered as an array (crl+shift+enter)?
Im interested in this lookup vector 9.99999999999999E+307

Thanks for all your help, its valuable and Im learning from it :)
 
Upvote 0
=IFERROR(LOOKUP(9.99999999999999E+307,SEARCH(" "&KeyWords&" "," "&$B2&" ")),Categories)

I added the bracket highlighted red for excel to accept the formula....

Im sure its close but my results just return #Name?

How does the formula know to look in Admin?
Does this need to be entered as an array (crl+shift+enter)?
Im interested in this lookup vector 9.99999999999999E+307

Thanks for all your help, its valuable and Im learning from it :)

Re-cap...

1) Let A1:B10 of a sheet called Admin house Text to Category associations. Let's name A2:A10 as KeyWords and B2:B10 as Categories.

2) Let A:M of Sheet1 house the data you want to categorize.

3) In N2 of Sheet1 enter and copy down:

=IFERROR(LOOKUP(9.99999999999999E+307,SEARCH(" "&KeyWords&" "," "&$B2&" "),Categories),"NA")

That is, I initially forgat to add the result argement for IFERROR. You will get a #NAME? error if you do not the instruction (1).

See the following links for explanations:
9.9999999 .... ?
vlookup with multiple matches - which match is returned
Is there a case sensitive VLOOKUP?
 
Upvote 0
Thanks for your prompt reply, I really appreciate your help.. Does it know to look in Admin?

With the amended formula I now get an NA result for N2 down.

Sheet 1 and sheet 2 renamed Admin:

Work OrderDescriptionHaslogEngineerLocationAssetStatusReported DatePriorityOwner GroupParent WOOut of ServiceKnown CostCategory
2364905QC17 TTY LOST gantry spreaderY8952TTYQC17J3900CLOSE30/11/14 05:01PFLFSQUDN8.71NA
2364210QC17 TTY NO UNDERCAB FLOODLIGHTS spreaderY7183TTYQC17J3900CLOSE30/11/14 02:26PFLFSQUDN279.37NA
2364101Liebherr Remedials - PLC Mounts broken (A)N8972TTYQC17J3900CLOSE29/11/14 10:34PFLFSQUDN0NA
2364100Liebherr Remedials - Hoist Drive Fans U/S ~ Replace (A)N8972TTYQC17J3900CLOSE29/11/14 10:33PFLFSQUDN0NA
2364099Liebherr Remedials - Hoist Drive Fans U/S ~ Replace gantryY8972TTYQC17J3900CLOSE29/11/14 10:32PFLFSQUDN0NA
KeyWordsCategories
spreaderspreader
framespreader
flipperspreader
flippersspreader
hoisthoist
lowerhoist
gantrygantry
assistassist
(A)assist

<COLGROUP><COL style="WIDTH: 48pt" span=2 width=64><TBODY>
</TBODY>

<COLGROUP><COL style="WIDTH: 48pt" span=14 width=64><TBODY>
</TBODY>
 
Upvote 0

Forum statistics

Threads
1,215,389
Messages
6,124,662
Members
449,178
Latest member
Emilou

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