How to calculate over or under based on dashed scores

honkin

Active Member
Joined
Mar 20, 2012
Messages
374
Office Version
  1. 2016
Platform
  1. MacOS
Hi

I have a sheet which records scores and other data from football matches around the world. I needed to be able to work out a winner from scores listed like 0-1, 2-2, 3-0 and so on

One of the members here offered a perfect formula which works well

=IF(LEFT(A1,FIND("-",A1)-1)+0>MID(A1,FIND("-",A1)+1,99)+0,"W","L")

I just change the > to < or = or <> depending on what sort of results I am monitoring

That all works well for determining a win or a draw, but how would it be amended to look for under or over a certain of goals?

Say I had a model which was backing Over 2.5 goals in a match; how would this be changed so it put a W or L if the score was >2 or <3? Obviously >2 means it is 3 or more and <3 means it is 2 or less, so will cover the 2.5 goals scenario. I can then change it depending on whether it is 2.5 goals, or 3.5 or even 0.5

Thanks in advance
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
is this the difference in the score or the total goals
assuming >3


1-0. not included.
3-0. not included as difference is 3 OR - as total goals are 3 , then not included
3-1 not included as difference is 2 OR - as total goals are 4 , then included
6-2 included as difference is 4 - OR - as total goals are 8 , then included

how do you get fractions of a goal
 
Upvote 0
is this the difference in the score or the total goals
assuming >3


1-0. not included.
3-0. not included as difference is 3 OR - as total goals are 3 , then not included
3-1 not included as difference is 2 OR - as total goals are 4 , then included
6-2 included as difference is 4 - OR - as total goals are 8 , then included

how do you get fractions of a goal
cheers etaf
It is total goals, not difference. You don't get fractions of goals, it is just how bookmakers frame a market. Goals are always Over 0.5, Over 1.5, Over 2.5 etc. There are also Under markets of the same thing

So to have the formula calculate >2 goals would be the same thing as >2.5 goals, as the next possibility is 3 and so on

I just need to be able to alter that original formula so it can determine if the total goals scored is a win or a loss

cheers
 
Upvote 0
Hi,

I'm not quite following regarding your requirements, can you show some sample data with expected results ?
 
Upvote 0
i'm also not 100% following, and examples would help

BUT , how about the following, if i have followed at all

this works out the total goals
LEFT(A2,FIND("-",A2)-1)+0+MID(A2,FIND("-",A2)+1,99)+0)
then you can hard code >2 or >3 <2 <3 etc
LEFT(A2,FIND("-",A2)-1)+0+MID(A2,FIND("-",A2)+1,99)+0) >2

Then , if thats True - use the original formula to work out a W or L

=IF((LEFT(A2,FIND("-",A2)-1)+0+MID(A2,FIND("-",A2)+1,99)+0) >2, IF( LEFT(A2,FIND("-",A2)-1)+0>MID(A2,FIND("-",A2)+1,99)+0,"W","L"), "below Goal Threshold")

you could have a title like
Threshold 2
and the formula work out the last number in this case 2
then

I have laid out various columns, for viewing , so you can see the formulas

A = the score 1-2 , 4-5 etc

B = Total goals
=LEFT(A2,FIND("-",A2)-1)+0+MID(A2,FIND("-",A2)+1,99)+0

C = Threshold Coded , where we hardcode the number 2,3 etc - this example is 2
=IF((LEFT(A2,FIND("-",A2)-1)+0+MID(A2,FIND("-",A2)+1,99)+0) >2, IF( LEFT(A2,FIND("-",A2)-1)+0>MID(A2,FIND("-",A2)+1,99)+0,"W","L"), "below Goal Threshold")

D = Threshold 2 - where the title is used to get the threshold - in this example 2
=IF((LEFT(A2,FIND("-",A2)-1)+0+MID(A2,FIND("-",A2)+1,99)+0) >RIGHT(D$1,1)+0, IF( LEFT(A2,FIND("-",A2)-1)+0>MID(A2,FIND("-",A2)+1,99)+0,"W","L"), "below Goal Threshold")

E = Win/Lose - your old formula , again just to see
=IF(LEFT(A2,FIND("-",A2)-1)+0>MID(A2,FIND("-",A2)+1,99)+0,"W","L")

Book1
ABCDE
1ResultGoalsthreshold codedthreshold 2Win/lose
21-01below Goal Thresholdbelow Goal ThresholdW
32-46LLL
46-17WWW
51-12below Goal Thresholdbelow Goal ThresholdL
62-57LLL
76-28WWW
81-23LLL
92-68LLL
106-39WWW
111-34LLL
Sheet2
Cell Formulas
RangeFormula
B2:B11B2=LEFT(A2,FIND("-",A2)-1)+0+MID(A2,FIND("-",A2)+1,99)+0
C2:C11C2=IF((LEFT(A2,FIND("-",A2)-1)+0+MID(A2,FIND("-",A2)+1,99)+0) >2, IF( LEFT(A2,FIND("-",A2)-1)+0>MID(A2,FIND("-",A2)+1,99)+0,"W","L"), "below Goal Threshold")
D2:D11D2=IF((LEFT(A2,FIND("-",A2)-1)+0+MID(A2,FIND("-",A2)+1,99)+0) >RIGHT(D$1,1)+0, IF( LEFT(A2,FIND("-",A2)-1)+0>MID(A2,FIND("-",A2)+1,99)+0,"W","L"), "below Goal Threshold")
E2:E11E2=IF(LEFT(A2,FIND("-",A2)-1)+0>MID(A2,FIND("-",A2)+1,99)+0,"W","L")
 
Upvote 0
Let's say team A & team B game score is in "a-b" format, the handycap is team A vs team B
for example, score: 2-0, handycap = 2.5, it means the actual score is : 2 - (0+2.5) = 2 - 2.5 ="Loss
3-1, handycap = 1.5, it means the actual score is : 3 - (1+1.5) = 3 - 2.5 ="Win"

With handycap = 2.5, the actual result is:
Code:
=IF(LEFT(A1,FIND("-",A1)-1)-MID(A1,FIND("-",A1)+1,99)>2.5,"W","L")
 
Upvote 0
Let's say team A & team B game score is in "a-b" format, the handycap is team A vs team B
for example, score: 2-0, handycap = 2.5, it means the actual score is : 2 - (0+2.5) = 2 - 2.5 ="Loss
3-1, handycap = 1.5, it means the actual score is : 3 - (1+1.5) = 3 - 2.5 ="Win"

With handycap = 2.5, the actual result is:
Code:
=IF(LEFT(A1,FIND("-",A1)-1)-MID(A1,FIND("-",A1)+1,99)>2.5,"W","L")
Cheers bebo021999
I am not trying to do anything with handicaps, like Asian Handicaps, it is simply to determine if the combined score is > or < a particular number of goals; 2.5 for example
This formula doesn't work. If the score is 2-1, it should indicate a W, as it is over 2.5 goals, but it remains as L
Ta
 
Last edited:
Upvote 0
Hi,

I'm not quite following regarding your requirements, can you show some sample data with expected results ?
Hi jtakw

OK, the examples are dead simple.

I'll just work it on Over 2.5 goals, as that one is pretty popular.

Scores - Result
1-1 L
2-1 W
0-0 L
1-0 L
3-0 W

So all I am trying to do is to have a W show if the combined score is over 2 (2.5 technically, but since over 2 means at least 3, it is fine)

Does that make sense?

The previous code works smashingly for W, L or Draw, as I just adjust the > to < or = or <> and that is fine. I was just struggling to have the same formula amended so it detected the total score and output a W or L result based on the number of goals.

I hope that helps
 
Upvote 0
thats pretty much what i posted
I'll just work it on Over 2.5 goals, as that one is pretty popular.

Scores - Result
1-1 L
2-1 W
0-0 L
1-0 L
3-0 W
if the total goals are NOT greater than 2, then its a L

in my case , I used "below goal threshold" , so that part of the formula becomes L

I assume
0-3 = L
2-6 = L
as they are greater than 2 goals - BUT the right-hand-side scored more and so as convention they won

I also added an iferror for error handling, blank cells etc - IFERROR()

Book1
ABCDEF
1ResultGoalsthreshold codedthreshold 2Win/lose
21-01LLW
32-46LLL
46-17WWW
51-12LLL
62-57LLL
76-28WWW
81-23LLL
92-68LLL
106-39WWW
111-34LLL
12    example
131-12LLL1-1 L
142-13WWW2-1 W
150-00LLL0-0 L
161-01LLW1-0 L
173-03WWW3-0 W
Sheet2
Cell Formulas
RangeFormula
B2:B17B2=IFERROR(LEFT(A2,FIND("-",A2)-1)+0+MID(A2,FIND("-",A2)+1,99)+0,"")
C2:C17C2=IFERROR(IF((LEFT(A2,FIND("-",A2)-1)+0+MID(A2,FIND("-",A2)+1,99)+0) >2, IF( LEFT(A2,FIND("-",A2)-1)+0>MID(A2,FIND("-",A2)+1,99)+0,"W","L"), "L"),"")
D2:D17D2=IFERROR(IF((LEFT(A2,FIND("-",A2)-1)+0+MID(A2,FIND("-",A2)+1,99)+0) >RIGHT(D$1,1)+0, IF( LEFT(A2,FIND("-",A2)-1)+0>MID(A2,FIND("-",A2)+1,99)+0,"W","L"), "L"),"")
E2:E17E2=IFERROR(IF(LEFT(A2,FIND("-",A2)-1)+0>MID(A2,FIND("-",A2)+1,99)+0,"W","L"),"")
 
Upvote 0
Hi jtakw

OK, the examples are dead simple.

I'll just work it on Over 2.5 goals, as that one is pretty popular.

Scores - Result
1-1 L
2-1 W
0-0 L
1-0 L
3-0 W

So all I am trying to do is to have a W show if the combined score is over 2 (2.5 technically, but since over 2 means at least 3, it is fine)

OK, keeping it simple, assuming single digit scores on either side, I think this should do what you want:

Book3.xlsx
AB
11-1L
22-1W
30-0L
41-0L
53-0W
Sheet1075
Cell Formulas
RangeFormula
B1:B5B1=IF(LEFT(A1)+RIGHT(A1)>2,"W","L")


And, in case for 2 digit scores, then:

Book3.xlsx
AB
11-1L
212-1W
30-1L
41-1L
53-10W
Sheet1075
Cell Formulas
RangeFormula
B1:B5B1=IF(LEFT(A1,FIND("-",A1)-1)+MID(A1,FIND("-",A1)+1,99)>2,"W","L")
 
Last edited:
Upvote 0
Solution

Forum statistics

Threads
1,214,954
Messages
6,122,461
Members
449,085
Latest member
ExcelError

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