+ Reply to Thread
Results 1 to 10 of 10

Ranking with duplicates and excluding zero

  1. #1
    Forum Contributor
    Join Date
    03-15-2012
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2019
    Posts
    327

    Ranking with duplicates and excluding zero

    Hi,

    I have a list of values which i need to rank.

    Some of the values are duplicates and some are zero.

    I am using the following formula for ranking the duplicates:

    =RANK(O3,O$3:O$84,0)+COUNTIF(O$3:O3,O3)-1

    I want to modify the formula to exclude the zero values...

    How do i do that?

    Thanks....
    Regards,
    Navin Agrawal

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,952

    Re: Ranking with duplicates and excluding zero

    One way:

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


    BSB

  3. #3
    Forum Contributor
    Join Date
    03-15-2012
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2019
    Posts
    327

    Re: Ranking with duplicates and excluding zero

    Quote Originally Posted by BadlySpelledBuoy View Post
    One way:

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


    BSB
    Thanks.... but will this take care of duplicate ranking also?

  4. #4
    Forum Contributor
    Join Date
    03-15-2012
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2019
    Posts
    327

    Re: Ranking with duplicates and excluding zero

    Quote Originally Posted by BadlySpelledBuoy View Post
    One way:

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


    BSB
    I dont think this is the solution....

    When copying your code, it merely leaves a blank wherever the value is ZERO is in "O" column..... the remaining numbers are still being ranked from 1 to 82!!

    what I mean to say is that if 40 out of the 82 values are ZERO..... there should be ranking only from 1 - 42....

  5. #5
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    19,043

    Re: Ranking with duplicates and excluding zero

    Quote Originally Posted by Navin Agrawal View Post
    what I mean to say is that if 40 out of the 82 values are ZERO..... there should be ranking only from 1 - 42....
    The best thing to do is attach a sample workbook. Make sure there is just enough data to demonstrate your need. Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    That said this formula may do what you want:
    Please Login or Register  to view this content.
    Let me know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  6. #6
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Ranking with duplicates and excluding zero

    Try this
    =IF(O3>0,RANK(O3,O$3:O$84,0)+COUNTIF(O$3:O3,O3)-1,"")

  7. #7
    Forum Contributor
    Join Date
    03-15-2012
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2019
    Posts
    327

    Re: Ranking with duplicates and excluding zero

    Thanks guys, but none of these seem to work....

    I am attaching a sample sheet to explain what i mean....
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    19,043

    Re: Ranking with duplicates and excluding zero

    Try pasting this formula in O3 and double clicking the fill handle to copy it down:
    Please Login or Register  to view this content.
    Let me know if you have any questions.
    Edit: If you only want to rank the non-zero values, which looking at R15:R23 doesn't seem likely, use the following:
    Please Login or Register  to view this content.
    Last edited by JeteMc; 04-28-2016 at 06:19 AM. Reason: Added Edit

  9. #9
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Ranking with duplicates and excluding zero

    Problem seems to be in O column.
    Now O35 & O40 are giving rank 8 and values appears 10.85.
    Just copy O35 and paste it to O40. Ranks will be 7 & 8. There is some problem with data not in formula. only to avoid rank for null value you can take formula in my previous post.

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,947

    Re: Ranking with duplicates and excluding zero

    Deleted as a previous posting from kvsrinivasamurthy had correct solution.
    Last edited by JohnTopley; 04-28-2016 at 06:12 AM.

+ 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. Ranking values and ranking duplicates the same rank
    By 302arpks in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 03-05-2015, 01:50 PM
  2. Ranking going from smallest to largest Excluding Blank Cells
    By Smilies in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-22-2013, 03:12 AM
  3. [SOLVED] Ranking with Duplicates
    By andrewc in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-25-2013, 08:03 AM
  4. ranking w/ duplicates
    By janeml in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-12-2013, 07:02 PM
  5. Excluding duplicates
    By analyst10 in forum Excel General
    Replies: 3
    Last Post: 11-22-2010, 08:19 PM
  6. Excel 2007 : Excluding from ranking
    By Airwalk in forum Excel General
    Replies: 1
    Last Post: 09-07-2010, 05:55 AM
  7. Replies: 6
    Last Post: 06-01-2010, 06:19 PM

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