SORT function - by lowest to higher duplicate

bllanko

New Member
Joined
Jul 16, 2009
Messages
42
****** http-equiv="Content-Type" content="text/html; charset=utf-8">****** name="ProgId" content="Word.Document">****** name="Generator" content="Microsoft Word 11">****** name="Originator" content="Microsoft Word 11"><link rel="File-List" href="file:///C:%5CTEMP%5Cmsohtml1%5C01%5Cclip_filelist.xml"><!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:PunctuationKerning/> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]--><style> <!-- /* Font Definitions */ @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-1610611985 1073750139 0 0 159 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} span.EmailStyle15 {mso-style-type:personal; mso-style-noshow:yes; mso-ansi-font-size:10.0pt; mso-bidi-font-size:10.0pt; font-family:Arial; mso-ascii-font-family:Arial; mso-hansi-font-family:Arial; mso-bidi-font-family:Arial; color:windowtext;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} --> </style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--> Hello,<o:p></o:p>
<o:p> </o:p>
I have around 800 line items in column “A” that I need to sort out based on how many of them are duplicates or more a like. Example if in column A I have mixed data than on either in same colum (“A”) or column “B” to be sorted by lowest to higher duplicate.<o:p></o:p>
<o:p> </o:p>
<o:p> </o:p>
Example below (note: colors coded are for explanation only):<o:p></o:p>
Mixed data To be sort like below:<o:p></o:p>
<table class="MsoNormalTable" style="width: 227.6pt; border-collapse: collapse;" border="0" cellpadding="0" cellspacing="0" width="303"> <tbody><tr style="height: 15pt;"> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="bottom" width="152" nowrap="nowrap"> Column A<o:p></o:p>
</td> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="bottom" width="152" nowrap="nowrap"> Column B<o:p></o:p>
</td> </tr> <tr style="height: 15pt;"> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="bottom" width="152" nowrap="nowrap"> A26329159<o:p></o:p>
</td> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="bottom" width="152" nowrap="nowrap"> A25221392<o:p></o:p>
</td> </tr> <tr style="height: 15pt;"> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="bottom" width="152" nowrap="nowrap"> A25221392<o:p></o:p>
</td> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="bottom" width="152" nowrap="nowrap"> A25221392<o:p></o:p>
</td> </tr> <tr style="height: 15pt;"> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="top" width="152" nowrap="nowrap"> A26329159
</td> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="bottom" width="152" nowrap="nowrap"> A25221392<o:p></o:p>
</td> </tr> <tr style="height: 15pt;"> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="top" width="152" nowrap="nowrap"> A26329159
</td> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="bottom" width="152" nowrap="nowrap"> A25658999<o:p></o:p>
</td> </tr> <tr style="height: 15pt;"> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="bottom" width="152" nowrap="nowrap"> A25658999<o:p></o:p>
</td> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="bottom" width="152" nowrap="nowrap"> A25658999<o:p></o:p>
</td> </tr> <tr style="height: 15pt;"> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="bottom" width="152" nowrap="nowrap"> A26329159<o:p></o:p>
</td> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="bottom" width="152" nowrap="nowrap"> A25658999<o:p></o:p>
</td> </tr> <tr style="height: 15pt;"> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="bottom" width="152" nowrap="nowrap"> A25221392<o:p></o:p>
</td> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="bottom" width="152" nowrap="nowrap"> A25658999<o:p></o:p>
</td> </tr> <tr style="height: 15pt;"> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="top" width="152" nowrap="nowrap"> A25658999
</td> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="bottom" width="152" nowrap="nowrap"> A25658999<o:p></o:p>
</td> </tr> <tr style="height: 15pt;"> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="top" width="152" nowrap="nowrap"> A25658999
</td> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="bottom" width="152" nowrap="nowrap"> A26329159<o:p></o:p>
</td> </tr> <tr style="height: 15pt;"> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="bottom" width="152" nowrap="nowrap"> A26329159<o:p></o:p>
</td> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="bottom" width="152" nowrap="nowrap"> A26329159<o:p></o:p>
</td> </tr> <tr style="height: 15pt;"> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="top" width="152" nowrap="nowrap"> A25658999
</td> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="bottom" width="152" nowrap="nowrap"> A26329159<o:p></o:p>
</td> </tr> <tr style="height: 15pt;"> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="top" width="152" nowrap="nowrap"> A25658999
</td> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="bottom" width="152" nowrap="nowrap"> A26329159<o:p></o:p>
</td> </tr> <tr style="height: 15pt;"> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="bottom" width="152" nowrap="nowrap"> A26329159<o:p></o:p>
</td> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="bottom" width="152" nowrap="nowrap"> A26329159<o:p></o:p>
</td> </tr> <tr style="height: 15pt;"> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="bottom" width="152" nowrap="nowrap"> A25221392<o:p></o:p>
</td> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="bottom" width="152" nowrap="nowrap"> A26329159<o:p></o:p>
</td> </tr> <tr style="height: 15pt;"> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="bottom" width="152" nowrap="nowrap"> A26329159<o:p></o:p>
</td> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="bottom" width="152" nowrap="nowrap"> A26329159<o:p></o:p>
</td> </tr> <tr style="height: 15pt;"> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="bottom" width="152" nowrap="nowrap"> A25658999<o:p></o:p>
</td> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="bottom" width="152" nowrap="nowrap"> A26329159<o:p></o:p>
</td> </tr> <tr style="height: 15pt;"> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="bottom" width="152" nowrap="nowrap"> A26329159<o:p></o:p>
</td> <td style="width: 113.8pt; padding: 0in 5.4pt; height: 15pt;" valign="bottom" width="152" nowrap="nowrap"> A26329159<o:p></o:p>
</td> </tr> </tbody></table>
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
In cell B2 have this formula (assumed headers in row 1):
=COUNTIF($A$2:$A$800,A2)
and copydown.
Sort primarily on column B (ascending), secondarily on column A (ascending).
Excel Workbook
AB
1Head1Head2
2A252213923
3A252213923
4A252213923
5A256589996
6A256589996
7A256589996
8A256589996
9A256589996
10A256589996
11A263291598
12A263291598
13A263291598
14A263291598
15A263291598
16A263291598
17A263291598
18A263291598
19
20
21
22Row LabelsCount of Head1
23A252213923
24A256589996
25A263291598
Sheet1



Alternatively create a pivot table, shown in A22:B25 above.
 
Upvote 0

Forum statistics

Threads
1,224,578
Messages
6,179,654
Members
452,934
Latest member
mm1t1

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