+ Reply to Thread
Results 1 to 4 of 4

Sort ignoring negatives and positives

  1. #1
    bangbanjo
    Guest

    Sort ignoring negatives and positives

    I need to sort a column of number values by the value ignoring negatives and
    positives. Example take the list:

    -5000
    -4000
    -1500
    1500
    4000
    5000

    and sort into this list
    -5000
    5000
    -4000
    4000
    -1500
    1500


  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good evening BangBanjo

    The only way I can think of doing this using the Excel sort function is to have an additional column inserted to use a sort key. If your data is in column A, starting at A1, put in column B1 =ABS(A1) and copy it down. This will give the absolute value (ie ignore minuses) and use this as your sort key. As this column is a formula it will change as the data in column A changes and could be hidden if required.

    Or you could write a macro to do this without the intermediate step...

    HTH

    DominicB

  3. #3
    Peo Sjoblom
    Guest

    Re: Sort ignoring negatives and positives

    You would need a help column, you can insert a temporary help column and use
    a formula like


    =ABS(A1)


    copy down, select both columns and sort by the help column descending


    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "bangbanjo" <[email protected]> wrote in message
    news:[email protected]...
    >I need to sort a column of number values by the value ignoring negatives
    >and
    > positives. Example take the list:
    >
    > -5000
    > -4000
    > -1500
    > 1500
    > 4000
    > 5000
    >
    > and sort into this list
    > -5000
    > 5000
    > -4000
    > 4000
    > -1500
    > 1500
    >



  4. #4
    bangbanjo
    Guest

    Re: Sort ignoring negatives and positives

    Thanks I will try that

    "dominicb" wrote:

    >
    > Good evening BangBanjo
    >
    > The only way I can think of doing this using the Excel sort function is
    > to have an additional column inserted to use a sort key. If your data
    > is in column A, starting at A1, put in column B1 =ABS(A1) and copy it
    > down. This will give the absolute value (ie ignore minuses) and use
    > this as your sort key. As this column is a formula it will change as
    > the data in column A changes and could be hidden if required.
    >
    > Or you could write a macro to do this without the intermediate step...
    >
    > HTH
    >
    > DominicB
    >
    >
    > --
    > dominicb
    > ------------------------------------------------------------------------
    > dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
    > View this thread: http://www.excelforum.com/showthread...hreadid=376939
    >
    >


+ 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