+ Reply to Thread
Results 1 to 7 of 7

I need a macro to select range of scores, choose the best scores and apply a formula

  1. #1
    Registered User
    Join Date
    07-12-2014
    Location
    invercargill, new zealand
    MS-Off Ver
    2007
    Posts
    26

    I need a macro to select range of scores, choose the best scores and apply a formula

    I'd much appreciate some help (as I've no idea what I'm doing) to create a macro that will select the latest 20 scores and differentials from a range, then choose the 10 lowest differentials and apply the following formula to them:

    Average 10 lowest differentials, multiply result by 113, then divide that result by 115, then multiply that result by 0.96. The final result will be the projected handicap index and will be activated by a button.

    The macro would update every time a new score/differential was added to the top of the range.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor fredlo2010's Avatar
    Join Date
    07-04-2012
    Location
    Miami, United States
    MS-Off Ver
    Excel 365
    Posts
    762

    Re: I need a macro to select range of scores, choose the best scores and apply a formula

    Hello,

    Try this formula:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This is an array formula so it will have to be entered with ctrl+shift+enter
    http://www.excel-easy.com/functions/array-formulas.html
    http://chandoo.org/wp/2010/06/04/ave...-top-5-values/

    Thanks

  3. #3
    Registered User
    Join Date
    07-12-2014
    Location
    invercargill, new zealand
    MS-Off Ver
    2007
    Posts
    26

    Re: I need a macro to select range of scores, choose the best scores and apply a formula

    Thanks very much for the formula, however, new scores added to the top of the range don't seem to be included as the range selection then changes to $c$5, $c$6 etc. am I doing something wrong?

    My problem is that when I insert another row the array range changes, I'll try to demonstrate in the worksheet attached.
    Last edited by hadleedog; 02-10-2015 at 02:24 AM. Reason: attempting to explain the issue

  4. #4
    Registered User
    Join Date
    07-12-2014
    Location
    invercargill, new zealand
    MS-Off Ver
    2007
    Posts
    26

    Re: I need a macro to select range of scores, choose the best scores and apply a formula

    I've tried using this formula, however, the same issue occurs when I insert a new row at the C4 position - The range then changes to $C$1 $C$24 which means more than 20 scores are being used and can make the outcome incorrect.

    =AVERAGE(SMALL($C$1:$C$23,{1,2,3,4,5,6,7,8,9,10}))*113/115*0.96

  5. #5
    Valued Forum Contributor fredlo2010's Avatar
    Join Date
    07-04-2012
    Location
    Miami, United States
    MS-Off Ver
    Excel 365
    Posts
    762

    Re: I need a macro to select range of scores, choose the best scores and apply a formula

    Hi,

    I am sorry for the late reply; I have been super busy

    Use this formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    where the new section added is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This last formula will return a range 1 row under the header (C3); no shift in the columns; the height is 20 rows; by 1 column: OFFSE($C$3,1,0,20,1)

    Hope it helps

  6. #6
    Registered User
    Join Date
    07-12-2014
    Location
    invercargill, new zealand
    MS-Off Ver
    2007
    Posts
    26

    Re: I need a macro to select range of scores, choose the best scores and apply a formula

    That's fantastic, works like a charm, thank you very much for that

  7. #7
    Valued Forum Contributor fredlo2010's Avatar
    Join Date
    07-04-2012
    Location
    Miami, United States
    MS-Off Ver
    Excel 365
    Posts
    762

    Re: I need a macro to select range of scores, choose the best scores and apply a formula

    You are welcome.

+ 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: 8
    Last Post: 12-20-2014, 04:37 PM
  2. Replies: 1
    Last Post: 06-15-2013, 09:02 PM
  3. [SOLVED] List the most recent five scores from among multiple scores
    By Winship in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-11-2012, 09:25 PM
  4. VB macro for sorting through scores and copying certain scores to new sheet
    By cowboy713 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-23-2010, 01:47 AM
  5. how to add weekly scores w/o showing current scores
    By breal33 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 12-02-2007, 11:56 PM

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