+ Reply to Thread
Results 1 to 14 of 14

HELP: Get top X values as column names not as values themselves ?

  1. #1
    Registered User
    Join Date
    06-02-2012
    Location
    Romania
    MS-Off Ver
    Excel 2010
    Posts
    95

    Question HELP: Get top X values as column names not as values themselves ?

    I have one table with ten columns and each column has as a name the numbers from 1 to 10, in ascending order: 1,2,3,4,5,6,7,8,9,10.
    On each row there are different values from 0 to 100+ which represents the numbers frequency, numbers been represented by each column name.

    Job to do:
    I want to get top X numbers which have the biggest values, for each row.
    For example, the first row has:
    1 2 3 4 5 6 7 8 9 10 <--- Column name (the numbers themselves).
    8 0 4 9 7 6 6 1 5 6 <---values as frequency.
    So, for this row I should get the following:
    Top 3 numbers are: 4,5,1.
    Which are, in fact, the column names and not the values from the rows but these column names are choose because they have the top 3 values from all this row, values been: 9,8 and 7.
    Second, if you want top 4 numbers then we should get:
    4,5,1,6,7,10. So, we get the column names as above because they have the top 3 values (9,7 and 8) + 4rd value which is 6 and on this row 6 is found on 3 cells, that is why we get 3 column names (numbers) instead: 6,7 and 10.

    How to do this ?
    Please help !

    Thank you !
    Attached Files Attached Files

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: HELP: Get top X values as column names not as values themselves ?

    You can do this in a 2-step process.

    First assume your X input value is in K1.

    In L1 enter formula:

    Please Login or Register  to view this content.
    copy across 10 columns and down.

    These columns can be hidden.

    Then in W4 enter formula:

    Please Login or Register  to view this content.
    confirmed with CTRL+SHIFT+ENTER not just ENTER and copied across 10 columns and down.
    Attached Files Attached Files
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    06-02-2012
    Location
    Romania
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: HELP: Get top X values as column names not as values themselves ?

    How to deal when you have more than 10 columns ?
    I have a table with 60 columns and after a while it shows to me #NUM! after a while of dragging the formula in all the cells.
    How to fix that ?

    Thank you !

    Found the fix: I did the other table on the other sheet. Now I put all the tables on the same sheet and it works.
    Last edited by Mr.Nob0OOdy; 06-16-2012 at 08:27 AM.

  4. #4
    Registered User
    Join Date
    06-02-2012
    Location
    Romania
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: HELP: Get top X values as column names not as values themselves ?

    HELP:
    It is not working to me.
    Look at this attachment in order to see what I did.

    http://www.crocko.com/608594BF452E47...0Testing_.xlsx

    As you can see on "Last 2" sheet, if you set your input to 1 or 2 it shows to you more than 1 or 2 numbers. Why ? What's wrong with it ?

    Thank you so much !

  5. #5
    Registered User
    Join Date
    06-02-2012
    Location
    Romania
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: HELP: Get top X values as column names not as values themselves ?

    None ? Please, guys, what's wrong with my file ? Why it shows more numbers ?

  6. #6
    Registered User
    Join Date
    06-02-2012
    Location
    Romania
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: HELP: Get top X values as column names not as values themselves ?

    BUMP The message you have entered is too short. Please lengthen your message to at least 10 characters.

  7. #7
    Registered User
    Join Date
    06-02-2012
    Location
    Romania
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: HELP: Get top X values as column names not as values themselves ?

    You can't download the file or what is the problem so I can fix it ?
    Thanks !

  8. #8
    Valued Forum Contributor
    Join Date
    04-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    547

    Re: HELP: Get top X values as column names not as values themselves ?

    Upload your file to the forum. Nobody wants to download from a site plastered with ads and wait times. Go Advanced > Paper Clip icon.
    Last edited by npamcpp; 06-17-2012 at 05:52 AM.
    Like a post? Click the star below it!

  9. #9
    Registered User
    Join Date
    06-02-2012
    Location
    Romania
    MS-Off Ver
    Excel 2010
    Posts
    95

    Question Re: HELP: Get top X values as column names not as values themselves ?

    File.xlsx

    Look, I have uploaded it to the board as attachment.


    As you can see on "Last 2" sheet, if you set your input to 1 or 2 it shows to you more than 1 or 2 numbers. Why ? What's wrong with it ?

    Thank you so much !

  10. #10
    Registered User
    Join Date
    06-02-2012
    Location
    Romania
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: HELP: Get top X values as column names not as values themselves ?

    So, now could someone help me, please ?

    Thank you so much !

  11. #11
    Registered User
    Join Date
    06-02-2012
    Location
    Romania
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: HELP: Get top X values as column names not as values themselves ?

    Any idea ? None ?

  12. #12
    Registered User
    Join Date
    06-02-2012
    Location
    Romania
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: HELP: Get top X values as column names not as values themselves ?

    BUMP The message you have entered is too short. Please lengthen your message to at least 10 characters.

  13. #13
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: HELP: Get top X values as column names not as values themselves ?

    According to your original post:

    Top 3 numbers are: 4,5,1.
    Which are, in fact, the column names and not the values from the rows but these column names are choose because they have the top 3 values from all this row, values been: 9,8 and 7.
    Second, if you want top 4 numbers then we should get:
    4,5,1,6,7,10
    So you say if you want top 4 you should get... 4,5,1,6,7,10. Isn't that more than 4 results? It's because one or more of the values that are smaller than 4th largest are repeated... same holds here. Your table only holds 0's, 1's and 2's ... so you are bound to get many repeats and therefore more than 1 or 2 results even if you enter 1 or 2.

  14. #14
    Registered User
    Join Date
    06-02-2012
    Location
    Romania
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: HELP: Get top X values as column names not as values themselves ?

    Ohh, you are right ! Sorry man !
    Thank you very much !

    [marked as solved now :D ]
    Last edited by Mr.Nob0OOdy; 06-18-2012 at 01:28 PM.

+ 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