+ Reply to Thread
Results 1 to 2 of 2

Trying to sort alphanumeric consecutively

  1. #1
    Registered User
    Join Date
    10-17-2011
    Location
    Upstate, NY
    MS-Off Ver
    Excel 2007
    Posts
    3

    Trying to sort alphanumeric consecutively

    I am trying to sort an alpha numeric strin consecutively, but can't seem to figure it out?

    HEre is a bit of what I ahve going on...

    R-1
    R-10
    R-100
    R-101
    R-102
    R-103
    R-104
    R-105
    R-106
    R-107
    R-108
    R-109
    R-11
    R-110
    R-111
    R-112
    R-113
    R-114
    R-115
    R-116
    R-117
    R-118
    R-119
    R-12
    R-120



    I can't get it to sort P1, P2, P3, but it seems to want to put the P2 value after the P-19 value and the P-3 value after the P-29 value??

    Thanks for any help here.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Trying to sort alphanumeric consecutively

    Your human eye gives a different context to these text strings than Excel does. They're text, so they sort in ascending order based on text ascendancy.

    The only way to get Excel to sort them as numbers is to add another column, pull in the numeric values only, then sort by the resulting new column.

    If those values are are A1 down, then in B1:

    =MID(A1, FIND("-", A1)+1, LEN(A1))+0
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ 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