Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Sep 2001
    Location
    Philadelphia suburbs
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    sort by last 4 digits in field (2000)

    I need to sort a spreadsheet with a column of accounts(some 12 digits and some 5 digits) by the last 4 digits so that, for example, 200100007805 and 27805 sort close together. Could anyone tell me the best way to do this?

    Thanks, Sue

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: sort by last 4 digits in field (2000)

    Without doing the sort in VBA code, you would need to create a new column with just the last four digits and sort on that column. If the accout number are in column A, starting in A2 (if you have a heading row in row 1), then find an empty column and put this formula in the cell in row 2 of that column:

    <code>
    =RIGHT(A2,4)
    </code>

    Copy that formula down as far as the account numbers go. Sort on that column.
    Legare Coleman

  3. #3
    Lounger
    Join Date
    Sep 2001
    Location
    Philadelphia suburbs
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: sort by last 4 digits in field (2000)

    Legare,

    Thanks so much. It worked perfectly.

    Sue

Posting Permissions

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