+ Reply to Thread
Results 1 to 6 of 6

load highest value from column to another

  1. #1
    Registered User
    Join Date
    06-02-2010
    Location
    n.ireland
    MS-Off Ver
    Excel 2007
    Posts
    91

    load highest value from column to another

    I have uploaded a w/book and hopfully someone will take a look.
    I have sales people and there sales amounts organized by location.What would like to do is load the top 20 (or there abouts) sales people&amounts from each loaction.
    ex north(Column A = 20 from columns F3 to J8). South (column B = 20 from F15 to J20) and so on.Thanking you.
    Attached Files Attached Files
    Last edited by dealer; 07-22-2010 at 02:34 PM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: load highest value from column to another

    Is this how your "real" file is configured - ie with "sales amounts" stored alongside names in alpha numeric strings ?

    If it is - you would really be best served considering a User Defined Function (VBA) as a formula approach will be hideously inefficient.

  3. #3
    Registered User
    Join Date
    06-02-2010
    Location
    n.ireland
    MS-Off Ver
    Excel 2007
    Posts
    91

    Re: load highest value from column to another

    No it's generally not but Because there will be a lot of people in different groups i wanted to see could it be done from the example i uploaded.And a VBA solution i would welcome cause then i can study how it works.

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: load highest value from column to another

    The below UDF utilises Chip Pearson's QSortInPlace Routine - this is of critical importance given it does the complex stuff
    (ie ordering the single dimension Array in reverse allowing you to extract values whilst handling duplicity etc)

    UDF:

    Please Login or Register  to view this content.
    Chip Pearson's code can be found within the attachment link provided on his webpage: http://www.cpearson.com/excel/SortingArrays.aspx


    With the UDF and Chip Pearson's code in place your in cell call would simply be:

    Please Login or Register  to view this content.
    A2:A21 can be copied across but you must of course adjust the sales ranges as appropriate (ie F3:J11 becomes F15:K22 for South etc...)

    Hopefully that's along the lines of what you wanted.

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: load highest value from column to another

    In retrospect - given the dependence upon CP's code I figured it would be easier to upload your sample file with code in place to avoid potential for confusion.

    Hopefully it helps you out.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    06-02-2010
    Location
    n.ireland
    MS-Off Ver
    Excel 2007
    Posts
    91

    Re: load highest value from column to another

    DonkeyOte,

    I am speechless that is some mighty code.

    It will take me a while to get my head round this.
    Thank you very much for your superb help.

+ 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