special sort on telephone numbers

Yaseraliakram

New Member
Joined
Nov 14, 2019
Messages
14
hi guys i have a table below.
In example a if i do the simple sort function i get result A, But i need to get to result B can anyone help me with this ?



Result A Result B
Algeria Mobile2135Algeria Mobile2135
Algeria Mobile2136Algeria Mobile21355
Algeria Mobile21355Algeria Mobile21356
Algeria Mobile21356Algeria Mobile213560
Algeria Mobile21365Algeria Mobile213561
Algeria Mobile21366Algeria Mobile2136
Algeria Mobile21367Algeria Mobile21365
Algeria Mobile21368Algeria Mobile213659
Algeria Mobile21369Algeria Mobile21366
Algeria Mobile213560Algeria Mobile21367
Algeria Mobile213561Algeria Mobile213670
Algeria Mobile213659Algeria Mobile21368
Algeria Mobile213670Algeria Mobile21369

<colgroup><col style="mso-width-source:userset;mso-width-alt:3140;width:69pt" width="92"> <col style="width:51pt" width="68" span="2"> <col style="mso-width-source:userset;mso-width-alt:3140;width:69pt" width="92"> <col style="width:51pt" width="68"> </colgroup><tbody>
</tbody>
 

Some videos you may like

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Giordano Bruno

Well-known Member
Joined
Jan 7, 2007
Messages
1,221
It appears to be sorting based on values. If you make another column with a formula like = text(value('phone number reference cell',"general")) and sort on that you should get what you want
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
44,404
Office Version
365
Platform
Windows
See if this does what you want. Add the following formula to a third column & copy down.

<b>Excel 2016</b><table cellpadding="2.5px" rules="all" style=";background-color: rgb(255,255,255);border: 1px solid;border-collapse: collapse; border-color: rgb(187,187,187)"><colgroup><col width="25px" style="background-color: rgb(218,231,245)" /><col /><col /><col /></colgroup><thead><tr style=" background-color: rgb(218,231,245);text-align: center;color: rgb(22,17,32)"><th></th><th>A</th><th>B</th><th>C</th></tr></thead><tbody><tr ><td style="color: rgb(22,17,32);text-align: center;">2</td><td style=";">Algeria Mobile</td><td style="text-align: right;;">2135</td><td style=";">Algeria Mobile2135</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">3</td><td style=";">Algeria Mobile</td><td style="text-align: right;;">2136</td><td style=";">Algeria Mobile2136</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">4</td><td style=";">Algeria Mobile</td><td style="text-align: right;;">21355</td><td style=";">Algeria Mobile21355</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">5</td><td style=";">Algeria Mobile</td><td style="text-align: right;;">21356</td><td style=";">Algeria Mobile21356</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">6</td><td style=";">Algeria Mobile</td><td style="text-align: right;;">21365</td><td style=";">Algeria Mobile21365</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">7</td><td style=";">Algeria Mobile</td><td style="text-align: right;;">21366</td><td style=";">Algeria Mobile21366</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">8</td><td style=";">Algeria Mobile</td><td style="text-align: right;;">21367</td><td style=";">Algeria Mobile21367</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">9</td><td style=";">Algeria Mobile</td><td style="text-align: right;;">21368</td><td style=";">Algeria Mobile21368</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">10</td><td style=";">Algeria Mobile</td><td style="text-align: right;;">21369</td><td style=";">Algeria Mobile21369</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">11</td><td style=";">Algeria Mobile</td><td style="text-align: right;;">213560</td><td style=";">Algeria Mobile213560</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">12</td><td style=";">Algeria Mobile</td><td style="text-align: right;;">213561</td><td style=";">Algeria Mobile213561</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">13</td><td style=";">Algeria Mobile</td><td style="text-align: right;;">213659</td><td style=";">Algeria Mobile213659</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">14</td><td style=";">Algeria Mobile</td><td style="text-align: right;;">213670</td><td style=";">Algeria Mobile213670</td></tr></tbody></table><p style="width:3.2em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid rgb(187,187,187);border-top:none;text-align: center;background-color: rgb(218,231,245);color: rgb(22,17,32)">Sort</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: rgb(255,255,255)" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: rgb(255,255,255);border-collapse: collapse; border-color: rgb(187,187,187)"><thead><tr style=" background-color: rgb(218,231,245);color: rgb(22,17,32)"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">C2</th><td style="text-align:left">=A2&B2</td></tr></tbody></table></td></tr></table><br />


Then select all 3 columns and sort on the new formula column. The result as follows and you can delete the extra column if desired

<b>Excel 2016</b><table cellpadding="2.5px" rules="all" style=";background-color: rgb(255,255,255);border: 1px solid;border-collapse: collapse; border-color: rgb(187,187,187)"><colgroup><col width="25px" style="background-color: rgb(218,231,245)" /><col /><col /><col /></colgroup><thead><tr style=" background-color: rgb(218,231,245);text-align: center;color: rgb(22,17,32)"><th></th><th>A</th><th>B</th><th>C</th></tr></thead><tbody><tr ><td style="color: rgb(22,17,32);text-align: center;">2</td><td style=";">Algeria Mobile</td><td style="text-align: right;;">2135</td><td style=";">Algeria Mobile2135</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">3</td><td style=";">Algeria Mobile</td><td style="text-align: right;;">21355</td><td style=";">Algeria Mobile21355</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">4</td><td style=";">Algeria Mobile</td><td style="text-align: right;;">21356</td><td style=";">Algeria Mobile21356</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">5</td><td style=";">Algeria Mobile</td><td style="text-align: right;;">213560</td><td style=";">Algeria Mobile213560</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">6</td><td style=";">Algeria Mobile</td><td style="text-align: right;;">213561</td><td style=";">Algeria Mobile213561</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">7</td><td style=";">Algeria Mobile</td><td style="text-align: right;;">2136</td><td style=";">Algeria Mobile2136</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">8</td><td style=";">Algeria Mobile</td><td style="text-align: right;;">21365</td><td style=";">Algeria Mobile21365</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">9</td><td style=";">Algeria Mobile</td><td style="text-align: right;;">213659</td><td style=";">Algeria Mobile213659</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">10</td><td style=";">Algeria Mobile</td><td style="text-align: right;;">21366</td><td style=";">Algeria Mobile21366</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">11</td><td style=";">Algeria Mobile</td><td style="text-align: right;;">21367</td><td style=";">Algeria Mobile21367</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">12</td><td style=";">Algeria Mobile</td><td style="text-align: right;;">213670</td><td style=";">Algeria Mobile213670</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">13</td><td style=";">Algeria Mobile</td><td style="text-align: right;;">21368</td><td style=";">Algeria Mobile21368</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">14</td><td style=";">Algeria Mobile</td><td style="text-align: right;;">21369</td><td style=";">Algeria Mobile21369</td></tr></tbody></table><p style="width:3.2em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid rgb(187,187,187);border-top:none;text-align: center;background-color: rgb(218,231,245);color: rgb(22,17,32)">Sort</p><br /><br />
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
44,404
Office Version
365
Platform
Windows
thnx working perfeclty
Sorry, I missed that reply. Does that mean that all your column A values are the same or that the column A value does not come into the sort at all?
 

Watch MrExcel Video

Forum statistics

Threads
1,095,232
Messages
5,443,263
Members
405,220
Latest member
gtgaabaron

This Week's Hot Topics

  • Copy entire row if CountA <>0 to another sheet
    [B]I want to copy entire row if CountA <>0 for column J7:AM7 (headers on J6:AM6) and so on till the last used cell is column D and paste the...
  • Select last used Row in Table
    I have created a Table in a Worksheet which is locked to prevent user errors and protect formula. Some of the cells require freetext entries which...
  • excel workbook: do not allow certain file name
    Hello all, Don't think this has ever been asked before, but how do I restrict file save [Before_Save Event] if the name of the file being saved...
  • fixing problem autofilter
    hello i need help about my code when i search by code in textbox it doesn't show anything this is my data [ATTACH type="full"...
  • “Weight”
    Hi, i’ve got a long sheet filled with weights such as kg,g,L & ml. i can build a formula to convert kg into g and liter into ml. How ever, my...
  • How to capitalize everything before a certain character?
    In column A, I have some text: Hello good day.mp3 Hello good day.flac etc. I'd like to capitalize everything before the period. I don't need the...
Top