+ Reply to Thread
Results 1 to 8 of 8

RANK function - to return data based on 2 different columns

  1. #1
    Registered User
    Join Date
    11-12-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    21

    RANK function - to return data based on 2 different columns

    Hello,

    I am trying to find a function to return the top 10 amounts (in cell) from a range...and return the top 10 in criteria as well as their corresponding rate code...in a separate column.

    Column A Column B
    BEDDING 10
    PILLOWS 13
    BLANKET 14
    SHEETS 11
    DUVET 7
    MATTRESS 5

    Etc....


    Please see attached example.

    Thank you VERY much
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: RANK function - to return data based on 2 different columns

    copy this down, it will give you the top 10...
    =LARGE($D$5:$D$565,ROW(A1))
    use this to extract the rate program...
    =INDEX(B:B,MATCH(F5,D:D,0),1)

    What to you want to do about duplicate matches?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    11-12-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: RANK function - to return data based on 2 different columns

    Thank you FDibbins!

    Thats a good question...is there a way to deliver duplicates?

    Ex,...if there were 5 cells tied...to deliver all 5?

    Thank you Again.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: RANK function - to return data based on 2 different columns

    I added a helper column in F and used this, copied down...
    =IF(D5=0,"",D5+COUNTIF($D$5:D5,D5)*0.1)

    then changed the formula for top 10 to...
    =INT(LARGE($F$5:$F$565,ROW(A1)))
    and to pull the rate program...
    =INDEX(B:B,MATCH(LARGE($F$5:$F$565,ROW(A1)),F:F,0),1)

  5. #5
    Registered User
    Join Date
    11-12-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: RANK function - to return data based on 2 different columns

    This is GREAT!

    Thank you FDibbins.

    I appreciate your help.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: RANK function - to return data based on 2 different columns

    Happy to help. If this answered your question, please take a moment to mark the thread as "solved" - it helps keep things neat and tidy lol, and consider adding the reputation to those that helped (see points 2 & 3 below)

  7. #7
    Registered User
    Join Date
    11-12-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: RANK function - to return data based on 2 different columns

    Sorry to bother you. I am having some issues with the formula(s) you gave me to use.
    Please see attached.
    The duplicates are coming up with the same rate program. In other words if there are 3 rate programs with 8 rooms...ex."MOTB" is coming up for all 3 results.
    Any help you can provide would be great.

    Thank you
    Attached Files Attached Files

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: RANK function - to return data based on 2 different columns

    You have only copied the forumla in F down as far as row 19, you have to copy it all the way down

+ 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