+ Reply to Thread
Results 1 to 8 of 8

Rank a column depending on date selected

Hybrid View

john_london Rank a column depending on... 09-11-2012, 12:43 PM
john_london Re: Rank a column depending... 09-12-2012, 04:53 AM
zbor Re: Rank a column depending... 09-12-2012, 04:57 AM
john_london Re: Rank a column depending... 09-12-2012, 05:39 AM
john_london Re: Rank a column depending... 09-12-2012, 06:29 AM
john_london Re: Rank a column depending... 09-12-2012, 07:46 AM
zbor Re: Rank a column depending... 09-12-2012, 07:53 AM
Ace_XL Re: Rank a column depending... 09-12-2012, 07:58 AM
  1. #1
    Registered User
    Join Date
    04-19-2010
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    86

    Rank a column depending on date selected

    Hi Guys -

    So I'm nearly there, but there's one bit which is annoying me.

    My original forumula which ranks a fixed colum is:

    =RANK(K2, K$2:K$191)+COUNTIF(K$2:K2,K2)-1
    Which works fine. WHat I need to do next is match the column to a date (selected_date).

    So far I have this:

    =RANK(INDEX($B2:$Z2,MATCH(selected_date,$B$1:$K$1,0)), K$2:K$191)+COUNTIF(K$2:K2,K2)-1
    Obviously this doesn't work because of the bold bits. What I need to do is apply the first bit to the whole column, e.g. K$2:K$191 needs to be rows 2 - 191 of whichever column I've selected, and the same for the COUNTIF bit.

    Aaaargh!

    Can anyone help?

    Thanks,
    John

  2. #2
    Registered User
    Join Date
    04-19-2010
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    86

    Re: Rank a column depending on date selected

    Sorry to be a pain - does this make sense?

    I guess I need to reference the whole row as well as a specific cell 0 and it's the row I can';t seem to figure out...

    Would I need to post a sample spreadsheet?

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,025

    Re: Rank a column depending on date selected

    can you upload example workbook?
    Never use Merged Cells in Excel

  4. #4
    Registered User
    Join Date
    04-19-2010
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    86

    Re: Rank a column depending on date selected

    Hi Sure (attached)

    So this is my problem:

    In the worksheet 'EU Funds', there are two columns of data in columns K and L for two different months.

    In Column A of the same sheet, the data is ranked (currently based on column L, August data).

    What I need to do, is use the selected date (in the Misc. Sheet, cell D19 - named selected_date_product) to rank a particular column.

    If the selected_date_product is Aug-12, I need Column A to rank based on column L. If the selected date was July-12, rank based on column K.

    So I guess the formula in column A:

    =RANK(L2, L$2:L$191)+COUNTIF(L$2:L2,L2)-1
    Rather than be fixed to column L, needs to change columns depending on the selected date.

    When I can get the rank column to work, I can use VLOOKUP to pull the relevant entries based on the position in the Funds sheet.

    Does this make sense!?

    Thanks,
    John
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-19-2010
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    86

    Re: Rank a column depending on date selected

    Is this okay? Apologies for the quality of the spreadsheet, I had to strip out lots of company-specific info...!

  6. #6
    Registered User
    Join Date
    04-19-2010
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    86

    Re: Rank a column depending on date selected

    I think I've got it

    If I put this in column A of the 'EU FuUnds' sheet and drag it down to the bottom cell, this seems to work:

    =RANK(INDEX($B2:$Z2,MATCH(selected_date_product,$B$1:$Z$1,0)),INDEX($B$2:$Z$191,1,MATCH(selected_date_product,$B$1:$Z$1)):INDEX($B$2:$Z$191,190,MATCH(selected_date_product,$B$1:$Z$1)))+COUNTIF(INDEX($B$2:$Z$191,1,MATCH(selected_date_product,$B$1:$Z$1)):INDEX($B2:$Z2,MATCH(selected_date_product,$B$1:$Z$1,0)), INDEX($B2:$Z2,MATCH(selected_date_product,$B$1:$Z$1,0)))-1
    Does this look right?

  7. #7
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,025

    Re: Rank a column depending on date selected

    This return same result as above. Or?

  8. #8
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Rank a column depending on date selected

    A bit long drawn..

    =CHOOSE(INDEX(Misc.!$D$2:$D$13,MATCH(Funds!$G$3,report_month,0)),RANK(K3,K$2:K$191)+COUNTIF(K$2:K3,K3),RANK(L3,L$2:L$191)+COUNTIF(L$2:L3,L3))-1

    You could add on other months as per the column to the highlighted as per the columns they appear in
    Life's a spreadsheet, Excel!
    Say thanks, Click *

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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