Sorting Rows with the Same Word

nick_floss

New Member
Joined
Jul 7, 2009
Messages
1
Is there any way to group rows with same words in a certain column?

I have a document with 3000 rows, and I'd like the rows to be sorted by the same word in a column. So, for example, the cells in a column may look like this:

A
1 Red Apple Green
2 Orange Pear Blue
3 Blue Green Orange

I would like the first and second rows to be the ones with "Green" in the column A. Is there a way I can sort that?
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
I B1 type this formula

=IF(ISERROR(SEARCH("green",A1)),2,1)

copy B1 down.till the data is available(not more)
now sort the data including columns A and B according to column B ascending.


I you want to do the same thing for green, orange, blue etc the formula will be complicated, better write a macro.

sample sheet wil be

<table x:str="" style="border-collapse: collapse; width: 243pt;" width="324" border="0" cellpadding="0" cellspacing="0"><col style="width: 171pt;" width="228"> <col style="width: 72pt;" width="96"> <tbody><tr style="height: 19.5pt;" height="26"> <td style="height: 19.5pt; width: 171pt;" width="228" height="26">Red Apple Green</td> <td style="width: 72pt;" x:num="" x:fmla="=IF(ISERROR(SEARCH("green",A1)),2,1)" width="96" align="right">1</td> </tr> <tr style="height: 19.5pt;" height="26"> <td style="height: 19.5pt;" height="26">Orange Pear Blue</td> <td x:num="" x:fmla="=IF(ISERROR(SEARCH("green",A2)),2,1)" align="right">2</td> </tr> <tr style="height: 19.5pt;" height="26"> <td style="height: 19.5pt;" height="26">Blue Green Orange</td> <td x:num="" x:fmla="=IF(ISERROR(SEARCH("green",A3)),2,1)" align="right">1</td> </tr> </tbody></table>
 
Upvote 0

Forum statistics

Threads
1,226,730
Messages
6,192,711
Members
453,748
Latest member
akhtarf3

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