Forum Discussion
Henne79
Mar 21, 2021Copper Contributor
How to categorise based on a specific word in a cell?
Hi guys, I am not sure excel can do what I need but here we go: In cell "A" I am being provided with a category with potentially lots of words. Based on one of those words I would like to cat...
Subodh_Tiwari_sktneer
Mar 21, 2021Silver Contributor
A sample file would be helpful to visualize what exactly you are trying to achieve.
- dmacgmeMar 21, 2021Copper ContributorYour exact example could be solved using the FIND function which will look in one cell for text specified in another cell. If (*note IF) it returns a number, you know your string is present, then use IF(A1>0,"boston","") and you get your desired word. However, as the previous response indicated, it is nearly impossible to give a more robust or complete answer to this question without more information.
- Henne79Mar 21, 2021Copper Contributor
dmacgme & Subodh_Tiwari_sktneer thank you so much for replying.
I have attached an excelark to this message which should explain my problem.
The "problem" is that I cannot edit the input (Colonne B) because it is given to me by a third party. Hope it make sense and that you can help me out.
Best regards,
Henne
- dmacgmeMar 21, 2021Copper ContributorFrom what I see you can still accomplish this using the simple construction I mentioned earlier. Use the FIND function to look for a word match in the string of text that you are given to that which you have defined if there is a match print that word into the desired cell. You dont need to edit any data for this, it is a logical test.
However, it is not clear if you are referring to your 'definition' table as a set or as individual cases, the way you have it laid out on the example makes it look like each line has its own definition table special case. I think you probably want to use the definition table as a complete set for comparison to make your matches rather than line by line.
As in:
If input data contains (Boston put Boston OR New York put New York..... and so on)
Like you want to extract the city name from whatever text is given. If so this is not much more complicated, but you will need to expand the function to include all of your city names not just one at a time. Include the set of names and implement the same logic.