HELP!!!!:How do I sort by a word in a phrase

L

Legacy 55384

Guest
Mr. Excel
I have a set of varieties that I want to sort by a trait of that variety for example
25550 flat seed corn
2920 plateless seed corn with poncho 1250
25550 flat seed corn with poncho 250
8396 Roundup Ready plateless seed corn
2920 plateless seed corn Yieldgard plus

with a couple of other variations, what I want to do is group together
all varieties with poncho 1250, Roundup ready, yieldgard plus, poncho 250, etc. no matter what else is in the cell
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
hi - welcome to the board!

in outline, the approach I would take is as follows:

1) Set up a 2 column table that relates each search target with a category vaule:
STRING | CATEGORY
poncho 1250 | 1
Roundup ready | 1
yieldgard plus | 1
poncho 250 | 1
KP Fertaliser | 2
Misc Product | 2

...etc

2) Set up a formula that searches for the strings & returns the category as a new value in your source table

3) Sort on the new vlaues.

...for specifics, tell us more about your data (how much, where in the file...), how many categories there are etc...
 
Upvote 0
This is what I've got so far but I can't get the trait out =MID(N5,IF(CODE(MID(N5,1,1))>57,1,IF(CODE(MID(N5,2,1))>57,2,IF(CODE(MID(N5,3,1))>57,3,4))),2) =LEFT(N5,FIND(O5,N5)-1) =RIGHT(N5,LEN(N5)-FIND(O5,N5)-1)

This pulls out all of the words from the numbers, however it doesn't take words away from words
 
Upvote 0
Can't you use "text to columns"?
Highlight the cell you want the text separated then In the menu bar select Data>TextToColumns


This will separate all text in cell into separate columns so you can sort how you wish.

Michael
 
Upvote 0
SOrry, kind of a rookie to the seperation of words, i'm not sure what you meanby VB, and the Text to column doesn't completly work because the phrases in the cells are many different lengths, I want to seperate at each space, but it varies per cell, the whole row is not the same length.

Thank you for all the help, it is getting me closer
 
Upvote 0
Ok, Text to columns works somewhat, but would prefer to be able to pull out a phase, not each individual space
 
Upvote 0

Forum statistics

Threads
1,214,907
Messages
6,122,181
Members
449,071
Latest member
cdnMech

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