Sorting....

Ruzzo

Board Regular
Joined
Nov 22, 2004
Messages
83
If in cells A1 through A6, I have the following listed:

Cars
Cars
Planes
Trains
Trains
Boats

This goes on for over 500 lines...some are duplicates, some don't have duplicates..
How do I sort out the duplicates from the none duplicates..
In other words...I want Cars, and then Trains...to appear first...but Boats, Planes to appear later...or vice versa. Duplicates to be separate from the non-dupes.
Is there a formula for this....Let say I want it to appear as such..

Cars
Cars
Trains
Trains
Boats
Planes

Thanks in advance.
Ruzzo
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
First use the Trim() formula on all the cells to ensure that you have no spaces or characters that would prevent you from filtering properly. You can also use the formula Upper(Trim(YourCellHere)) to make all of the characters exactly the same. Next you can use conditional formatting to highlight exact duplicate cells. From there you can sort the cells by cell color then by name and you have an easy way to remove your dupes.
 
Upvote 0
As mike suggested use the TRIM function first.
Then in B1 copy down:
=IF(COUNTIF($A$1:$A$500,A1)>1,"Duplicate","No Duplicate")

Then sort by column B.
 
Upvote 0
Next you can use conditional formatting to highlight exact duplicate cells. From there you can sort the cells by cell color then by name and you have an easy way to remove your dupes.
You refer to sorting by color which would indicate you are using Excel 2007+. In that case there is no need to Conditional Format or sort by color since versions of Excel since then contain a built-in tool for removing duplicates - check Data ribbon tab --> Remove Duplicates
 
Upvote 0

Forum statistics

Threads
1,224,585
Messages
6,179,706
Members
452,939
Latest member
WCrawford

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