+ Reply to Thread
Results 1 to 9 of 9

sort one positive and one negative number

Hybrid View

  1. #1
    Registered User
    Join Date
    02-09-2012
    Location
    virigina
    MS-Off Ver
    2010
    Posts
    17

    sort one positive and one negative number

    Hi All,

    I have about 300 line items and i have both negative and positive duplicates. Is their anyway i can sort these line items so it will show like this.
    5
    -5
    3
    -3
    20
    -20 and so on...

    any help would be appreciated! Thank you
    Last edited by NBVC; 02-14-2012 at 04:14 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: sort one positive and one negative number

    in another column enter helper formula like:

    =ABS(A1)

    copied down, where A1 contains first number in your original list.

    Then Sort first by the formula column, then by the original column.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,756

    Re: sort one positive and one negative number

    If your positives and negatives are in A2 down then perhaps use a blank column with this formula in row 2

    =ABS(A2)

    Now select all data including the new column and sort by the new column
    Audere est facere

  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: sort one positive and one negative number

    Try using a helper column then sort on that
    With your data in A2 down
    In B2
    =ABS(A2)
    Sort by Column B Ascending and by Column A Descending
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  5. #5
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: sort one positive and one negative number

    What's the logic in 5's appearing before 3's?

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,079

    Re: sort one positive and one negative number

    Here, try this:
    Attached Files Attached Files
    Last edited by zbor; 02-14-2012 at 10:56 AM.
    Never use Merged Cells in Excel

  7. #7
    Registered User
    Join Date
    02-09-2012
    Location
    virigina
    MS-Off Ver
    2010
    Posts
    17

    Re: sort one positive and one negative number

    Thank you all I appreciate it a lot. Their is no logic in the 5's coming before the 3's I was just trying to make an example. But again thank you very much for helping me out

  8. #8
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: sort one positive and one negative number

    Fair enough. Always useful if the example represents what you actually want

    Dom

  9. #9
    Registered User
    Join Date
    02-09-2012
    Location
    virigina
    MS-Off Ver
    2010
    Posts
    17

    Re: sort one positive and one negative number

    Yeah I understand, I guess I was just in a hurry and those numbers are the first that came into mind. Thank you though I appreciate it

+ 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