I am trying to create a score sheet for a charity Bowls competition.
I need to award points as follows: If team A scores more shots than team B, team A will be awarded 2 points and team B will be awarded none. The reverse is also true. Then, if both teams score the same number of shots, they will both be awarded 1 point each.
I have got as far as the following bit of code =IF(A2>B2;2;0) that awards points if A scores more than B or none if the score I less. What I cant figure out is how to include a test for equal scores that then awards one point each.
[Solved] Create Bowls comp score sheet
[Solved] Create Bowls comp score sheet
Last edited by MrProgrammer on Tue Jul 09, 2019 9:49 pm, edited 2 times in total.
Reason: Moved from General Discussion to Calc forum -- MrProgrammer 2019-07-09 14:48
Reason: Moved from General Discussion to Calc forum -- MrProgrammer 2019-07-09 14:48
Open office version is 4.1.5: Operating system is Windows 10.
- MrProgrammer
- Moderator
- Posts: 4907
- Joined: Fri Jun 04, 2010 7:57 pm
- Location: Wisconsin, USA
Re: Creat Bowls comp score sheet.
Hi, and welcome to the forum.
A's points: =SIGN(A2-B2)+1
B's points: =SIGN(B2-A2)+1
«or»
A's points: =(A2>B2)+(A2>=B2)
B's points: =(B2>A2)+(B2>=A2)
If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
[Tutorial] Ten concepts that every Calc user should know
Assuming A's score in A2 and B's score in B2:OXONBOD wrote:If team A scores more shots than team B, team A will be awarded 2 points and team B will be awarded none. The reverse is also true. Then, if both teams score the same number of shots, they will both be awarded 1 point each.
A's points: =SIGN(A2-B2)+1
B's points: =SIGN(B2-A2)+1
«or»
A's points: =(A2>B2)+(A2>=B2)
B's points: =(B2>A2)+(B2>=A2)
If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
[Tutorial] Ten concepts that every Calc user should know
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
Re: Create Bowls comp score sheet
Many thanks. The second set of code works fine. Could you explain how it works?
Open office version is 4.1.5: Operating system is Windows 10.
Re: Create Bowls comp score sheet
From Section 1 of the tutorial MrProgrammer linked above:
A2>B2 is either TRUE or FALSE; similarly A2>=B2 is either TRUE or FALSE.The special values TRUE and FALSE are really numbers. TRUE has the value 1 and FALSE has the value 0
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.2.2; SlackBuild for 24.2.2 by Eric Hameleers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.2.2; SlackBuild for 24.2.2 by Eric Hameleers