+ Reply to Thread
Results 1 to 5 of 5

Sort text Values in Numeric Order

  1. #1
    Karl Burrows
    Guest

    Sort text Values in Numeric Order

    I changed a field type in Access from Number to Text to allow 1a, 1b, etc.
    and now when the data is imported into my Excel workbooks, the order is
    still sorting as text (1, 10, 100, 101, 2, 20, etc.). Any thought son how
    to get it to sort correctly now?

    Thanks!



  2. #2
    Bob Phillips
    Guest

    Re: Sort text Values in Numeric Order

    Karl,

    IN an adjacent column add this formula

    =--A1

    copy down and then sort by the helper column.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Karl Burrows" <[email protected]> wrote in message
    news:[email protected]...
    > I changed a field type in Access from Number to Text to allow 1a, 1b, etc.
    > and now when the data is imported into my Excel workbooks, the order is
    > still sorting as text (1, 10, 100, 101, 2, 20, etc.). Any thought son how
    > to get it to sort correctly now?
    >
    > Thanks!
    >
    >




  3. #3
    Karl Burrows
    Guest

    Re: Sort text Values in Numeric Order

    Anything that has a text value (1a, 1b, 1c), gives me a #VALUE error and it
    still wants to sort as a text value. Any other suggestions?

    Thanks!

    "Bob Phillips" <[email protected]> wrote in message
    news:[email protected]...
    Karl,

    IN an adjacent column add this formula

    =--A1

    copy down and then sort by the helper column.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Karl Burrows" <[email protected]> wrote in message
    news:[email protected]...
    > I changed a field type in Access from Number to Text to allow 1a, 1b, etc.
    > and now when the data is imported into my Excel workbooks, the order is
    > still sorting as text (1, 10, 100, 101, 2, 20, etc.). Any thought son how
    > to get it to sort correctly now?
    >
    > Thanks!
    >
    >





  4. #4
    Dave Peterson
    Guest

    Re: Sort text Values in Numeric Order

    If you separate your values into two helper cells--one for the numeric portion
    and one for the text portion, you can sort your data based on those two helper
    columns.

    Depending on what your data looks like, you could use Data|Text to columns or
    formulas to parse those values.

    You may want to post a representative sample of what your data looks like.

    Karl Burrows wrote:
    >
    > Anything that has a text value (1a, 1b, 1c), gives me a #VALUE error and it
    > still wants to sort as a text value. Any other suggestions?
    >
    > Thanks!
    >
    > "Bob Phillips" <[email protected]> wrote in message
    > news:[email protected]...
    > Karl,
    >
    > IN an adjacent column add this formula
    >
    > =--A1
    >
    > copy down and then sort by the helper column.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    > "Karl Burrows" <[email protected]> wrote in message
    > news:[email protected]...
    > > I changed a field type in Access from Number to Text to allow 1a, 1b, etc.
    > > and now when the data is imported into my Excel workbooks, the order is
    > > still sorting as text (1, 10, 100, 101, 2, 20, etc.). Any thought son how
    > > to get it to sort correctly now?
    > >
    > > Thanks!
    > >
    > >


    --

    Dave Peterson

  5. #5
    Karl Burrows
    Guest

    Re: Sort text Values in Numeric Order

    Here is what I ended up doing:

    Added a function to my VBA module:
    Function CellValue(c) As Double
    CellValue = Val(c)
    End FunctionThen created a column using =CellValue(A1) and copied down
    for all the values in the column and then sorted by this row first, then the
    original column of data.This seemed to work for what I wanted. Thanks for
    your help!!!
    "Dave Peterson" <[email protected]> wrote in message
    news:[email protected]...
    If you separate your values into two helper cells--one for the numeric
    portion
    and one for the text portion, you can sort your data based on those two
    helper
    columns.

    Depending on what your data looks like, you could use Data|Text to columns
    or
    formulas to parse those values.

    You may want to post a representative sample of what your data looks like.

    Karl Burrows wrote:
    >
    > Anything that has a text value (1a, 1b, 1c), gives me a #VALUE error and
    > it
    > still wants to sort as a text value. Any other suggestions?
    >
    > Thanks!
    >
    > "Bob Phillips" <[email protected]> wrote in message
    > news:[email protected]...
    > Karl,
    >
    > IN an adjacent column add this formula
    >
    > =--A1
    >
    > copy down and then sort by the helper column.
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    > "Karl Burrows" <[email protected]> wrote in message
    > news:[email protected]...
    > > I changed a field type in Access from Number to Text to allow 1a, 1b,
    > > etc.
    > > and now when the data is imported into my Excel workbooks, the order is
    > > still sorting as text (1, 10, 100, 101, 2, 20, etc.). Any thought son
    > > how
    > > to get it to sort correctly now?
    > >
    > > Thanks!
    > >
    > >


    --

    Dave Peterson



+ 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