+ Reply to Thread
Results 1 to 6 of 6

Sort according to number

  1. #1
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Sort according to number

    Hello everyone
    I have these values in range("A1:A15")
    Yasser 4
    Yasser 1
    Yasser 10
    Yasser 11
    Yasser 12
    Yasser 13
    Yasser 2
    Yasser 14
    Yasser 16
    Yasser 3
    Yasser 5
    Yasser 6
    Yasser 7
    Yasser 8
    Yasser 9

    When sorting these values I have incorrect results .. I want to sort according to the name and the number
    The names may be different but most names has suffix of numbers at the end
    The expected Results would be Yasser 1, Yasser 2 , and so on

  2. #2
    Spammer
    Join Date
    02-04-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2013
    Posts
    190

    Re: Sort according to number

    make from yasser 1 to yasser 01 and sort

  3. #3
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Sort according to number

    Is there a nother way to do the task without changing all my data?

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Sort according to number

    UDF?

    Row\Col
    A
    B
    1
    Input
    Pad
    2
    Yasser 4 Yasser 04
    3
    Yasser 1 Yasser 01
    4
    Yasser 10 Yasser 10
    5
    Yasser 11 Yasser 11
    6
    Yasser 12 Yasser 12
    7
    Yasser 13 Yasser 13
    8
    Yasser 2 Yasser 02
    9
    Yasser 14 Yasser 14
    10
    Yasser 16 Yasser 16
    11
    Yasser 3 Yasser 03
    12
    Yasser 5 Yasser 05
    13
    Yasser 6 Yasser 06
    14
    Yasser 7 Yasser 07
    15
    Yasser 8 Yasser 08
    16
    Yasser 9 Yasser 09


    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Sort according to number

    Hi Yasser,

    Try to add a helper column with the length of the numbers and sort by A first and B second. See the attached.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  6. #6
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Sort according to number

    Thanks Mr. shg for this pretty function
    Thanks Mr. MarvinP for this tricky solution ..
    Without helper columns .. How can I achieve the sort process directly by subroutine?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Sort by number of characters?
    By DrSues02 in forum Excel General
    Replies: 5
    Last Post: 01-16-2011, 04:21 PM
  2. Excel 2007 : Sort number intervals
    By mossman in forum Excel General
    Replies: 4
    Last Post: 12-28-2009, 06:08 AM
  3. Separate and sort Number
    By 9khonnei in forum Excel General
    Replies: 2
    Last Post: 09-24-2009, 05:45 AM
  4. Need to sort number in col A to sum numbers in Col. B
    By anakinflair in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 12-10-2008, 11:27 AM
  5. Sort Text & Number
    By Irina in forum Excel General
    Replies: 4
    Last Post: 11-28-2006, 12:44 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1