+ Reply to Thread
Results 1 to 3 of 3

Function/Macro To Determine High Values From Unsorted Array

  1. #1
    Registered User
    Join Date
    07-07-2010
    Location
    Emporia, KS
    MS-Off Ver
    Excel 2000
    Posts
    5

    Function/Macro To Determine High Values From Unsorted Array

    I administer a football pool and need some function/macro help. My worksheet is like the following:

    Player A B C D E
    No. of Wins 10 12 11 12 12
    Tiebreaker Points 50 43 24 47 38

    Final Score 45

    I need the function(s) or macro to do the following things:

    1. Compare "No. of wins" to determine the highest value. If there is only one player that has the most wins (no ties), then that player is automatically the winner.
    2. Compare the "Tiebreaker" points of those who have the most wins to determine the closest value that is less than or equal to "Final Score" (the values will be unsorted, just like they are shown).
    3. If all of the "Tiebreaker" points are greater than "Final Score", then determine the value closest to "Final Score."
    4. Identify the player who is the winner based on who had the most wins and who was closest to the final score without going over or, if everyone went over, who was closest to the final score.
    5. If I use a macro, I need to be able to run the macro to produce the result and the result needs to save with the worksheet so I can e-mail it to other people. I don't want them to have to run the macro again (once they receive the worksheet) to view the results.

    I would prefer to use functions and if I have to use multiple functions in multiple cells that would be fine.

    Thanks for any and all help.
    Last edited by damalco; 07-08-2010 at 12:22 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Function/Macro To Determine High Values From Unsorted Array

    Here's one way:
    Please Login or Register  to view this content.
    In B5 and across: =B2 - IF(B3>$B$4, 100, $B$4-B3)/100 - ABS(B3-$B$4)/10000

    In B6: =INDEX(B1:F1, MATCH(MAX(B5:F5), B5:F5, 0))
    Last edited by shg; 07-08-2010 at 12:07 PM.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    07-07-2010
    Location
    Emporia, KS
    MS-Off Ver
    Excel 2000
    Posts
    5

    Re: Function/Macro To Determine High Values From Unsorted Array

    That worked great! Thank you so much for your help.
    Last edited by shg; 07-08-2010 at 12:06 PM. Reason: deleted quote

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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