+ Reply to Thread
Results 1 to 9 of 9

Numerically Rank High to low positives then low to high negatives

  1. #1
    Registered User
    Join Date
    09-27-2019
    Location
    Dublin
    MS-Off Ver
    Office 365 Pro Plus
    Posts
    22

    Numerically Rank High to low positives then low to high negatives

    Hi, I'm trying to figure out a formula for a table that will give me a numerical rank from high to low if the value is positive, then low to high if negative.

    E.g.


    Value Desired rank
    100 2
    -50 6
    -400 4
    60 3
    210 1
    -70 5

    Any thoughts?

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,980

    Re: Numerically Rank High to low positives then low to high negatives

    RANK does that by default, since that's just descending order - e.g.
    =RANK(A2,$A$2:$A$7,0)

    Edit: ignore - I didn't read very carefully!
    Last edited by romperstomper; 08-29-2024 at 08:21 AM.
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,568

    Re: Numerically Rank High to low positives then low to high negatives

    Paste this into B1 and hit ENTER:

    Please Login or Register  to view this content.
    AliGW on MS365 Beta Channel (Windows 11) 64 bit

    A
    B
    1
    100
    2
    2
    -50
    6
    3
    -400
    4
    4
    60
    3
    5
    210
    1
    6
    -70
    5
    Sheet: Sheet1
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,863

    Re: Numerically Rank High to low positives then low to high negatives

    Try
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This will do reversed ranking for negative values, but increased by the count of non-negative
    Last edited by Kaper; 08-29-2024 at 08:11 AM. Reason: Corrected to take into account header in row 1
    Best Regards,

    Kaper

  5. #5
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,863

    Re: Numerically Rank High to low positives then low to high negatives

    Or equivalent formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by Kaper; 08-29-2024 at 08:10 AM. Reason: Corrected to take into account header in row 1

  6. #6
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,904

    Re: Numerically Rank High to low positives then low to high negatives

    Another way,

    B2
    Please Login or Register  to view this content.
    copy down.

  7. #7
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,176

    Re: Numerically Rank High to low positives then low to high negatives

    Or try this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,246

    Re: Numerically Rank High to low positives then low to high negatives

    One way:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,246

    Re: Numerically Rank High to low positives then low to high negatives

    Is this resolved?

    Sample file attached with all the soutions.


    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon (Next to Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 3
    Last Post: 02-24-2023, 12:41 AM
  2. [SOLVED] Return numbers high to low using formula (includes negatives)
    By 63falcondude in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-25-2021, 06:25 PM
  3. Sorting mixed letters/numbers from low to high numerically
    By joe_schmo95 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-14-2020, 07:49 AM
  4. How do I rank cells from high to low?
    By lanespoli in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-22-2019, 12:30 PM
  5. [SOLVED] Rank items in Pivot table from high to low and low to high based on the filter selected
    By jholiday78 in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 02-19-2017, 11:22 AM
  6. [SOLVED] rank top 5 high
    By eccie in forum Excel General
    Replies: 6
    Last Post: 01-18-2016, 01:42 PM
  7. High Low Close Chart - How to add High & Low labels
    By stephenedwardbennett in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 10-23-2015, 06:45 AM

Tags for this Thread

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