+ Reply to Thread
Results 1 to 7 of 7

Row and column labels of ranked data

  1. #1
    Registered User
    Join Date
    08-31-2010
    Location
    Bern, Switzerland
    MS-Off Ver
    Excel 2007
    Posts
    5

    Row and column labels of ranked data

    Hi all,

    I have a table with data (A1:C16) of which I have ranked the top 15 (F2:F16). Now, I would like columns H and J to indicate the respective row and column labels for these top values. I guess this should be possible with match/index in an array function, but I cannot get it done. Can somebody help? Many thanks!
    Attached Files Attached Files
    Last edited by Ulrich; 08-31-2010 at 10:41 AM.

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,443

    Re: Row and column labels of ranked data

    Hi,

    In H2

    =INDEX($A$2:$A$16,IFERROR(MATCH(F2,$B$2:$B$16,0),MATCH(F2,$C$2:$C$16,0)))

    copied down will return the row label,

    and in I2

    =INDEX($B$1:$C$1,MATCH(F2,OFFSET($B$2:$C$2,MATCH(H2,$A$2:$A$16,0)-1,0),0))

    copied down will return the column label.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Row and column labels of ranked data

    As far as I'm concerned, you don't need an array formula.

    To figure out the country, you can use

    =INDEX($A$2:$A$16,IF(ISNA(MATCH(F2,$B$2:$B$16,0)),MATCH(F2,$C$2:$C$16,0),MATCH(F2,$B$2:$B$16,0)))

    To figure out the Incident number you can use

    =IF(ISNA(MATCH(F2,$B$2:$B$16,0)),"Incident 2","Incident 1")

    copy both formulae down.

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Row and column labels of ranked data

    Ah, sweep, you beat me to it. And then you used the IFERROR, to boot.

    Anyway, for all you Excel 2003 users out there: sweep's solution works fine in XL 2007 and later (and, after all, the OP has indicated that s/he is using 2007), my suggestion works in all versions (even the later ones), even though a bit clumsier.

    cheers

  5. #5
    Registered User
    Join Date
    08-31-2010
    Location
    Bern, Switzerland
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Row and column labels of ranked data

    Brilliant! Many thanks.

    Now, in 'real life' I have about 70 incidence columns which will make the formulae in H quite long. Is there a way of simplifying that?

  6. #6
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,443

    Re: Row and column labels of ranked data

    These are both array formulas and will return row and column heading respectively.

    =INDEX($A$1:$A$16,MIN(IF($B$2:$C$16=F2,ROW($B$2:$C$16))))

    =INDEX($A$1:$C$1,MIN(IF($B$2:$C$16=F2,COLUMN($B$2:$C$16))))

  7. #7
    Registered User
    Join Date
    08-31-2010
    Location
    Bern, Switzerland
    MS-Off Ver
    Excel 2007
    Posts
    5

    Smile Re: Row and column labels of ranked data

    Marvellous! Thank you so much!

+ 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