+ Reply to Thread
Results 1 to 9 of 9

Rank numbers in list that has duplicates, but exclude zeros

  1. #1
    Registered User
    Join Date
    02-27-2015
    Location
    California
    MS-Off Ver
    2010
    Posts
    5

    Question Rank numbers in list that has duplicates, but exclude zeros

    I have a column that can hold 25 numbers. If there are less than 25, the balance are zeros. I want to rank the numbers, not the zeros, even if there are duplicates. Does any one know how? If I could only combine the two formulas below.


    This formula works well to rank the numbers greater than zero, but gives the same rank to duplicate numbers. =IF(W7<0, RANK(W7,$W$7:$W$31)-COUNTIF($W$7:$W$31,0), IF(W7=0,"", RANK(W7,$W$7:$W$31)))


    This formula ranks every number, even duplicates, but always includes the zeros {=SUM(1*(R7>$R$7:$R$31))+1+IF(ROW(R7)-ROW($R$7)=0,0,SUM(1*(R7=OFFSET($R$7,0,0,INDEX(ROW(R7)-ROW($R$7)+1,1)-1,1))))}

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Rank numbers in list that has duplicates, but exclude zeros

    Post some sample data and show us what results you expect.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    02-27-2015
    Location
    California
    MS-Off Ver
    2010
    Posts
    5

    Re: Rank numbers in list that has duplicates, but exclude zeros

    The attached spreadsheet has a column of data on the left. In that column I want to be able to enter from one to twenty five numeric values. I want the column on the right to rank the numbers on the left, but ignore zeros and duplicate values. The attached spreadsheet assigns a unique rank to each value like I want, but doesn't ignore the zeros. Hope this makes sense.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Rank numbers in list that has duplicates, but exclude zeros

    See the green cells.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  5. #5
    Registered User
    Join Date
    02-27-2015
    Location
    California
    MS-Off Ver
    2010
    Posts
    5

    Smile Re: Rank numbers in list that has duplicates, but exclude zeros

    Thank you so much. This will make the spreadsheet so much easier to use.

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Rank numbers in list that has duplicates, but exclude zeros

    Thanks for the reply.

    Glad i could help.

  7. #7
    Registered User
    Join Date
    02-27-2015
    Location
    California
    MS-Off Ver
    2010
    Posts
    5

    Question Re: Rank numbers in list that has duplicates, but exclude zeros

    I just wish I understood more about how it works.

  8. #8
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Rank numbers in list that has duplicates, but exclude zeros

    I thought you wanted all ranks to be different, doesn't that solution give the same rank to equal values?

    If you want all ranks to be different try this formula in C7 copied down

    =IF(B7=0,"",COUNTIFS(B$7:B$31,"<"&B7,B$7:B$31,">0")+COUNTIF(B$7:B7,B7))

    If you want the highest value to rank 1 (not the lowest) just replace the < with >
    Last edited by daddylonglegs; 03-02-2015 at 07:10 PM.
    Audere est facere

  9. #9
    Registered User
    Join Date
    02-27-2015
    Location
    California
    MS-Off Ver
    2010
    Posts
    5

    Re: Rank numbers in list that has duplicates, but exclude zeros

    You are right. I did not see the duplicate ranks.

+ 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. [SOLVED] Count a filtered list but exclude the zeros
    By clarcombe in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-25-2014, 04:14 AM
  2. Replies: 3
    Last Post: 01-22-2013, 06:11 PM
  3. Numbering a sequential list, but exclude a list of given numbers.
    By Fiebuls in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-12-2012, 03:29 AM
  4. Replies: 2
    Last Post: 08-10-2007, 08:44 AM
  5. [SOLVED] Count 350 SS numbers, exclude duplicates
    By Marsha in forum Excel General
    Replies: 5
    Last Post: 03-07-2005, 02:06 PM

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