+ Reply to Thread
Results 1 to 5 of 5

Change Row to Column Based on Rank Function

  1. #1
    Registered User
    Join Date
    09-16-2011
    Location
    Minnesota
    MS-Off Ver
    Excel 2007
    Posts
    30

    Change Row to Column Based on Rank Function

    I have a row of stock symbols at the top of my Excel 2007 workbook, call it row A. Several rows below this I have a numeric value for each stock symbol, based on a rank function, call it row Z.

    I want to take the symbols in the top row of my workbook and display them as a column on a new sheet, in order of the numeric rank assigned to each symbol.

    For example, stock ABC has rank value of 3, XYZ is ranked 1, and AAA is ranked 2. I want the new sheet to display:


    XYZ
    AAA
    ABC

    Any idea on how to code this?

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Change Row to Column Based on Rank Function

    Let's call them Row 1 and Row 10, since rows have numbers and columns have letters.

    If the numbers are unique, this formula, dragged down, should work,

    =INDEX(Sheet1!$1:$1, 1, MATCH(SMALL(Sheet1!$10:$10,ROW(A1)), Sheet1!$10:$10, 0))
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Registered User
    Join Date
    09-16-2011
    Location
    Minnesota
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Change Row to Column Based on Rank Function

    Thanks, one question/additional detail - the data in Row 1 starts in column D, as does the data in row 10 (column D), and both end at column CZ. I'm assuming there needs to be some modification to the formula?

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Change Row to Column Based on Rank Function

    Does it work as written?
    What alterations have been tried?

  5. #5
    Registered User
    Join Date
    09-16-2011
    Location
    Minnesota
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Change Row to Column Based on Rank Function

    It did not work as is. Here is what I've tried so far with no success

    =INDEX(Performance Dashboard!$D3:$D3, 1, MATCH(SMALL(Performance Dashboard!$D946:$D946,ROW(D3)), Performance Dashboard!$D946:$D946, 0))

    =INDEX(Performance Dashboard!$D3:$CZ3, 1, MATCH(SMALL(Performance Dashboard!$D946:$CZ946,ROW(D3)), Performance Dashboard!$D946:$CZ946, 0))

+ 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