+ Reply to Thread
Results 1 to 6 of 6

Sorting Column Values (Ascending Year)

  1. #1
    Registered User
    Join Date
    10-20-2010
    Location
    Berlin
    MS-Off Ver
    Excel 2003
    Posts
    39

    Sorting Column Values (Ascending Year)

    Hi,

    I have values in Column A ( row 5 onwards) in the form of YY_ABCD eg. 02_0030

    The YY part shows the year and the part after the underscore "_" is a number.

    I want to arrange this data in ascending year form. I have data here starting from the year 1950 to 2010 (50_XXXX to 10_XXXX). So after sorting the column should start from 50_XXXX to 10_XXXX ( including the year 2000 i.e. 00_XXXX).

    Can anyone show me how to do this in Excel or through a macro ?

    Thank You,
    JN
    Last edited by jimmy_nora; 11-12-2010 at 04:18 AM.

  2. #2
    Registered User
    Join Date
    10-20-2010
    Location
    Berlin
    MS-Off Ver
    Excel 2003
    Posts
    39

    Re: Sorting Column Values (Ascending Year)

    Posting:
    http://www.mrexcel.com/forum/showthread.php?t=507480

  3. #3
    Valued Forum Contributor blane245's Avatar
    Join Date
    02-20-2009
    Location
    Melbourne, FL
    MS-Off Ver
    Excel 2010
    Posts
    649

    Re: Sorting Column Values (Ascending Year)

    If you don't mind adding another column you could construct the year to be sorted on by the function
    Please Login or Register  to view this content.
    in, say C5, copying it down the column, and sort on column C. Note that the value 20 is used to separate the centuries. You could use any value that is appropriate to your data.
    Bob
    Click my star if my answer helped you. Mark the thread as [SOLVED] if it has been.

  4. #4
    Registered User
    Join Date
    10-20-2010
    Location
    Berlin
    MS-Off Ver
    Excel 2003
    Posts
    39

    Re: Sorting Column Values (Ascending Year)

    according to you code the 00_XXXX shows the year 1900 , whereas it is supposed to be 2000. The data is from 1950 through 2000 till 2010.

  5. #5
    Valued Forum Contributor blane245's Avatar
    Join Date
    02-20-2009
    Location
    Melbourne, FL
    MS-Off Ver
    Excel 2010
    Posts
    649

    Re: Sorting Column Values (Ascending Year)

    Sorry about that. I needed to use the value function to convert the string to a number. try this
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    10-20-2010
    Location
    Berlin
    MS-Off Ver
    Excel 2003
    Posts
    39

    Re: Sorting Column Values (Ascending Year)

    Thank You very much

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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