+ Reply to Thread
Results 1 to 4 of 4

How to RANK based on 2 columns

  1. #1
    Registered User
    Join Date
    04-25-2013
    Location
    Phils
    MS-Off Ver
    Office Professional Plus 2016
    Posts
    46

    How to RANK based on 2 columns

    Hi,
    I am trying to rank my data in Excel based on two columns. The 2 columns are CYCLE and DURATION. The ranking should work like this:

    It should rank CYCLE first then DURATION second.
    The formula should work even if the data is not sorted or with blanks.

    For instance, here is my sample data and the EXPECTED ranking:

    Duration Cycle Rank
    0:44:59 1 6
    1:24:02 2 2
    0:56:59 1 8
    2:00:09 2 5
    0:45:06 1 7
    1:46:07 2 4
    2:25:12 3 1
    1:32:56 2 3


    I found through a lengthy search an exact same scenario with mine, using this formula:
    =COUNTIF($G$2:$G$9,">"&G2)+SUMPRODUCT(--($G$2:$G$9=G2),--($F$2:$F$9<F2))+1

    It works ONLY if the data has no blank rows. My actual data has random blank or incomplete rows so the formula above will not work in my case.
    I cannot attach the file here, the paper clip icon is not working. I uploaded the file through Manage Attachments and here is the link of my attachment:
    http://www.excelforum.com/attachment...1&d=1459470449

    If the link above does not work, here is another one:
    http://filesxpress.com/download-74e4...4109d85337337d

    Thank you and I hope you can assist.
    Attached Files Attached Files
    Last edited by kolokoy; 03-31-2016 at 08:45 PM.

  2. #2
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,914

    Re: How to RANK based on 2 columns

    Try this in D2:
    =IF(B2="","",SUM(IF($B$2:$B$21="","",--($C$2:$C$21-$B$2:$B$21>C2-B2)))+1)
    Enter with Ctrl+Shift+Enter

  3. #3
    Registered User
    Join Date
    04-25-2013
    Location
    Phils
    MS-Off Ver
    Office Professional Plus 2016
    Posts
    46

    Re: How to RANK based on 2 columns

    Thank you very much! That is the exact formula that I needed... I do not understand that complex formula though, but it worked!!

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,914

    Re: How to RANK based on 2 columns

    You're welcome!

+ 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. Need to rank a columns contents based on another column
    By pongmeister in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-27-2016, 12:39 AM
  2. Replies: 6
    Last Post: 11-30-2013, 09:14 AM
  3. Replies: 1
    Last Post: 11-30-2013, 06:48 AM
  4. Macro to Shift Columns based on Rank Value
    By eemrun in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-03-2013, 07:11 AM
  5. [SOLVED] Rank function, based on 2 criteria / columns
    By Hein in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-31-2013, 11:34 PM
  6. [SOLVED] RANK function - to return data based on 2 different columns
    By Adsup01 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-30-2013, 08:17 PM
  7. Replies: 1
    Last Post: 08-15-2005, 05:05 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