Golf Simulator League - Calculating Golf Handicaps for Google Sheets

tcmaes

New Member
Joined
Feb 6, 2014
Messages
9
Office Version
  1. 365
Platform
  1. Windows
Good morning. I've only posted on this website a couple times, although I have been an admirer for many years. I am always impressed by the solutions provided by this community.

My question today relates to creating a spreadsheet that automatically calculates the handicap indexes of golfers in my golf league. The handicap index is calculated based on all past golf rounds played. I have a handy table outlining how the handicap index is calculated based on the first round played until any subsequent rounds played.

1.PNG


Currently, I have been using a combination of IF statements, ROUNDDOWN, AVERAGE, and SMALL functions to calculate the handicap indexes. However, as the number of golf rounds increases, this method has become increasingly complex. It is especially challenging when there are 21 or more golf rounds, as this requires calculating the average of the lowest 8 golf rounds out of the last 20 golf rounds.

For the 21+ golf rounds (orange), I have attempted to use an ArrayFormula along with SMALL, OFFSET, LARGE, and ROW functions. However, I have not been able to get it to work consistently, particularly when there are blank cells in between. Moreover, the formula does not seem to work when combined with the IF statements I created for the first 20 golf rounds (green).

If there are any experts who can help me simplify my worksheet to resolve this issue, I would be immensely grateful. Please find an example dataset below and the expected output. Here is also a link to a shared google sheet that I created with four sample datasets: Excel Help

2.png
 
Last edited by a moderator:

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
What version of Excel are you using? Or is this for use in Sheets.
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
Fluff, thank you for your reply. This spreadsheet would live in Google Sheets.
 
Upvote 0
Questions for sheets should be posted in the General Discussion & Other Applications section of the board & it should be made clear what app you are using.
I have done that for you this time.

Unfortunately I don't know enough about Sheets to help.
 
Last edited:
Upvote 0
Whilst this works in xl365 it appears that Sheets does not have the TAKE function
Excel Help.xlsx
ABCDEFKLMNO
1
2
3Golfer 1Golfer 2Golfer 3Golfer 4New Formula G1New Formula G2New Formula G3New Formula G4
4Week 1192317NERNERNERNER
5Week 2151916NERNERNERNER
6Week 3121212NERNER12
7Week 41713151213NER12
8Week 51314111213NER11
9Week 617201412.513NER11.5
10Week 779.513NER11.5
11Week 8141989.513.5NER9.5
12Week 99199.313.5NER9.5
13Week 101318249.313.5NER10.3
14Week 111416159.313.5NER10.3
15Week 1214141210.213.5NER10.3
16Week 13615148.513.6NER10.7
17Week 14813247.513.3NER10.7
18Week 15157.513.3NER10.7
19Week 161813158.413.2NER10.7
20Week 17128.413.2NER10.7
21Week 182310913.21010.7
22Week 1918913.21010.7
23Week 20159.513.21010.7
24Week 21191013.21010.7
25Week 2212179.813.21010.7
26Week 231123109.613.21010.2
27Week 241516999.713.4910
28Week 25239169.713.4910
29Week 26148219.713.48.510.3
30Week 2721289189.713.58.510.3
31Week 281213159.613.58.510.8
32Week 29912589.813.17.310.5
33Week 309147109.513.26.610
34Week 31111912149.713.36.610
35Week 3210599.513.36.29.6
36Week 335149.513.35.59.6
37Week 3411179.313.349.1
38Week 35113179.313.33.89.1
39Week 36679.313.33.89
40Week 374-168.813.32.68.2
41Week 3813168.813.32.68.2
42Week 398.813.32.68.2
43Week 4071768.313.338.2
44Week 4113888.313.238
45Week 4212134178.313.23.18
46Week 431119478.313.23.27.6
47Week 441068.213.23.27.6
48Week 452138.213.237.6
49Week 468.213.237.6
Sheet1
Cell Formulas
RangeFormula
L4:O49L4=LET(n,{3,6,9,12,15,17,19,20},MAP(SEQUENCE(COUNTA($B$4:$B$200)),LAMBDA(a,LET(d,C4:INDEX(C4:C200,a),f,TAKE(FILTER(d,d<>""),-20),r,COUNT(f),IF(r<3,"NER",ROUNDDOWN(AVERAGE(TAKE(SORT(f),XMATCH(r,n,-1))),1))))))
Dynamic array formulas.
 
Last edited:
Upvote 1
Replaced the TAKE with INDEX & works in xl, but doesn't seem to in Sheets
Excel Formula:
=LET(n,{3,6,9,12,15,17,19,20},MAP(SEQUENCE(COUNTA($B$4:$B$200)),LAMBDA(a,LET(d,C4:INDEX(C4:C200,a),f,FILTER(d,d<>""),r,COUNT(f),x,INDEX(f,SEQUENCE(MIN(r,20),1,MAX(1,r-19))),IF(r<3,"NER",ROUNDDOWN(AVERAGE(INDEX(SORT(x),SEQUENCE(XMATCH(r,n,-1)))),1))))))
 
Upvote 0
This seems to work
Excel Formula:
=LET(n,{3,6,9,12,15,17,19,20},MAP(SEQUENCE(COUNTA($B$4:$B$200)),LAMBDA(a,LET(d,C4:INDEX(C4:C200,a),f,FILTER(d,d<>""),r,COUNT(f),x,query(f,"Select * offset "&max(0,r-20)),IF(r<3,"NER",ROUNDDOWN(AVERAGE(SORTN(x,XMATCH(r,n,-1))),1))))))
 
Upvote 0
Fluff, I appreciate your ongoing assistance. Your latest formula is nearly there.

However, I have noticed that the formula you provided is shifted by one row from what I was anticipating. Please refer to the image below. I was expecting NERs for the first three weeks.
3.PNG


I attempted to modify the formula myself by changing r<3 to r<4, which did resolve the issue with NERs. However, it did not resolve the problem with the other scores. I apologize as I am still in the process of learning Excel/Google Sheets formulas.

Any suggestions? Thanks, Tim.
 
Upvote 0
Why should the 3rd row return NER as there are 3 rounds played & the scoring chart shows that as the minimum value.
 
Upvote 0
My apologies for not explaining this clearly earlier. The Handicap is calculated prior to the commencement of the round. As an example, the Handicap displayed in the Handicap section of Week 7 reflects the calculation based on the scores from Week 1-6.

To provide a more detailed explanation, please refer to the following breakdown by week. I hope this clears it up a bit.

1697672343298.png
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,106
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top