Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi - I'm a golf fanatic trying to do some analysis of my golf scores,
counting the number of pars, birdies, bogeys I get during any given round of golf. Assume two rows, 18 columns; I want to count the number of of occurences that the top row cell (for example B1) equals the bottom row cell (B2); how often the top row cell (C1 for example) = bottom row cell (C2 for example) +1; how often the top row cell = bottom row cell -1; etc. The top row is par for the hole, remains constant; The second row is my score on that hole. The formulas provide me with the number of pars, birdies bogeys etc I get on any given round of golf. Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Assuming that Row 1 will be the hole numbers and Column A will be for players names: Sub golf() Dim P As Range For Each p In Range("B2:S2") If P.Value = P.Offset(1, 0) Then Par = Par + 1 ElseIf p.Value - 1 = P.Offset(1, 0) Then Birdie = Birdie + 1 ElseIf p.Value - 2 = P.Offset(1, 0) Then Eagle = Eagle + 1 ElseIf p.Value + 1 = P.Offset(0, 1) Then Bogey = Bogey + 1 Elseif p.Value + 2 = p.Offset(0, 1) Then DBogey = DBogey + 1 Else Throw_out = Throw_out + 1 End If Next MsgBox Par & " Pars." & vbLf & _ Birdie & " Birdies." & vbLf _ Eagle & " Eagles." & vbLf _ Bogey & " Bogeys." & vbLf _ DBogey & " Double Bogeys." & vbLf _ Throw_out & " Throw out holes." End Sub This will give you the whole picture. "Lee H" wrote: Hi - I'm a golf fanatic trying to do some analysis of my golf scores, counting the number of pars, birdies, bogeys I get during any given round of golf. Assume two rows, 18 columns; I want to count the number of of occurences that the top row cell (for example B1) equals the bottom row cell (B2); how often the top row cell (C1 for example) = bottom row cell (C2 for example) +1; how often the top row cell = bottom row cell -1; etc. The top row is par for the hole, remains constant; The second row is my score on that hole. The formulas provide me with the number of pars, birdies bogeys etc I get on any given round of golf. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Counting occurences of a name | Excel Worksheet Functions | |||
Counting occurences of characters in a cell | Excel Worksheet Functions | |||
Counting the occurences | Excel Worksheet Functions | |||
Counting Occurences | Excel Discussion (Misc queries) | |||
Help on counting occurences | Excel Programming |