+ Reply to Thread
Results 1 to 13 of 13

top 10 from data table

  1. #1
    Forum Contributor
    Join Date
    01-16-2013
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    136

    top 10 from data table

    Hi,

    I wish to get the top 10 names and addresses based on their score stored in the data table on the attached. Depending on which person I select in cell C3 of the output sheet. The example shows the output if John was selected.


    Is there an event driven macro that can be created to do this.
    top 10.xlsx
    See attached spread sheet.

    Any help much appreciated.


    James

  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,946

    Re: top 10 from data table

    For the score (I presume you meant number? there is no "score" heading), use this ARRAY formula, copied down...
    =IF(OR(A3 < A1,A3 > C18),0,IF(A3>A2,1000,(A3-A1)*0.01))

    However, you have duplicates in your data, how do you want to handle that?
    G
    H
    I
    6
    6 Roe Lane, Birkin, Knottingley, North Yorkshire WF11 9LP, UK
    982931
    Pass
    7
    39 Blind Lane, Todmorden, West Yorkshire OL14 5HZ, UK
    982931
    Pass


    The rest of the info can be pulled using this...
    =INDEX(Input!B$2:B$183,MATCH(Output!$D6,Input!$C$2:$C$183,0))
    copied down and across (to the Pass/Fail column)
    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
    Forum Contributor
    Join Date
    01-16-2013
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    136

    Re: top 10 from data table

    This doesnt seem to work. ?Is there not a clever way to do this with VBA

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: top 10 from data table

    Hi,

    Try this:Batchjb.xlsm
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  5. #5
    Forum Contributor
    Join Date
    01-16-2013
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    136

    Re: top 10 from data table

    This is excellent xladept any chance you could add comments into the code so I can learn what its doing

  6. #6
    Forum Contributor
    Join Date
    01-16-2013
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    136

    Re: top 10 from data table

    Actually Ive just realised It seems to work for John but not the others. If you change it to Sylvia the numbers are not in top ten Order

  7. #7
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: top 10 from data table

    Hi,

    Thanks for the rep!

    It's working now just replace the code in your output sheet module:

    Please Login or Register  to view this content.
    Last edited by xladept; 07-01-2014 at 02:31 PM.

  8. #8
    Forum Contributor
    Join Date
    01-16-2013
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    136

    Re: top 10 from data table

    Top10 v2.xlsm

    Thanks for looking but I've found your solution has the same issue.

    Any Ideas

  9. #9
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: top 10 from data table

    Hi Batch,

    I just double checked with the file you attached: Dave Starts with 819646 and Ends with 349572 which are the first and tenth Dave entries???

    Do we have a failure to communicate here

  10. #10
    Forum Contributor
    Join Date
    01-16-2013
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    136

    Re: top 10 from data table

    Its giving the first 10 figures but not the top ten number( by top ten i mean largest numbers) dave should start 977436, 909148 , 903172 etc

    Apologies maybe i didnt make this clear.

  11. #11
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,573

    Re: top 10 from data table

    This should do
    Attached Files Attached Files

  12. #12
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: top 10 from data table

    What we had there was a failure to communicate - I imagine that Jindon has solved your problem

  13. #13
    Valued Forum Contributor
    Join Date
    03-20-2011
    Location
    UK
    MS-Off Ver
    Excel 2007/10/16
    Posts
    840

    Re: top 10 from data table

    Hi

    See the file!
    No VBA!
    Reason notice problem with John

    Simple formula with no problem!

    Regard
    micope21
    Attached Files Attached Files
    To help you by my post? it would be nice to click on to say "Thank you".
    If you are happy with a solution to your problem?
    Click Thread Tools above your first post,
    select "Mark your thread as Solved".

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 11-28-2013, 02:10 AM
  2. Replies: 0
    Last Post: 09-05-2012, 06:12 PM
  3. Export Excel data into Access table - overwrite table data
    By Jonsocks in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-08-2012, 12:05 PM
  4. Replies: 0
    Last Post: 02-20-2012, 02:53 PM
  5. Creating Monthly Data Table from Weekly Data Table
    By nhojflies in forum Excel General
    Replies: 15
    Last Post: 06-19-2009, 09:11 AM

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