Simple if and question

muppet77

Board Regular
Joined
Jan 24, 2004
Messages
223
I am after a formula that tells me if a bet I have placed has won and in what way.
It is to do with Asian handicap betting. I shall explain more.

I have a bet in a1 that I have made.
It may be -1, which means that I have bet on the away team to win by 1 or more goals.
It could be a positive value. Eg +3 which means I think the home team will win by 3 or more.
If I bet +2 and the result is exactly +2 then the bet is refunded with no profit.

However it could also be a half, quarter or 3/4 value.

For example half a goal means that there cannot be a draw. So if I bet +2.5 or more, +3 will win but +2 will lose.
If I bet -4.5 and the result is -4, the bet loses and -5 would win.

A quarter goal bet means that half your bet is placed on a full goal bet an half is placed on the half goal bet. This means that you can win both halves, lose both halves or win one and lose the other.

A three quarter goal handicap also exists. This splits the bet between the half and full goal handicap.

A much better explanation can be found at
Asian Handicap Explained

So I have my bet in a1, and the result in b1.
A positive result means home team wins and a negative means away team wins with zero meaning a draw.

Can anyone help me write a formula for c1 that returns the result
Eg
Win
Lose
Void
Win half
Lose half

Thanks.
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
I'll take these one at a time. I'm going to assume you don't want VBA.

For a simple or half bet, you could use this:

Code:
=IF(A1=B1,"Tie",IF(AND(SIGN(A1)=SIGN(B1),ABS(B1)>ABS(A1)),"Win","Loss"))

(Note: I don't know how you treat a bet of 0).

Increasing it to a quarter bet is tougher, but doable. I think this formula now works for results of 0, but only for a bet of +/-.25 (I'm assuming that if you bet +/-.25, one bet is a loss and one is a tie).

Code:
=IF(ABS(A1)-INT(ABS(A1))=0.25,CHOOSE(IF((A1+0.25)=B1,0,IF(AND(IF((A1+0.25)=0,SIGN(A1),SIGN(A1+0.25))=SIGN(B1),ABS(B1)>ABS(A1+0.25)),1,-1))+IF((A1-0.25)=B1,0,IF(AND(IF((A1-0.25)=0,SIGN(A1),SIGN(A1-0.25))=SIGN(B1),ABS(B1)>ABS(A1-0.25)),1,-1))+3,"Full Loss","Half Loss","Push","Half Win","Full Win"),IF(A1=B1,"Tie",IF(AND(SIGN(A1)=SIGN(B1),ABS(B1)>ABS(A1)),"Win","Loss")))

And the 3/4 bets only get more complicated than that... it'd be a whole lot easier to use the first or second formula and manually make the bets you want to place. And really, now that I've done this all using Excel formulas, it'd be a butt-ton easier to do this in VBA as a UDF... at least you wouldn't have to repeat so many sections of the code. Hope this helps.

<edit> [edit] Actually on second look, the 3/4 bet might be really easy to add in there. I think it has the exact same logic as the quarter bet, correct? In which case, all you'd need to do is add a little bit to the front:

Code:
=IF(OR(ABS(A1)-INT(ABS(A1))=0.25,ABS(A1)-INT(ABS(A1))=0.75),CHOOSE(IF((A1+0.25)=B1,0,IF(AND(IF((A1+0.25)=0,SIGN(A1),SIGN(A1+0.25))=SIGN(B1),ABS(B1)>ABS(A1+0.25)),1,-1))+IF((A1-0.25)=B1,0,IF(AND(IF((A1-0.25)=0,SIGN(A1),SIGN(A1-0.25))=SIGN(B1),ABS(B1)>ABS(A1-0.25)),1,-1))+3,"Full Loss","Half Loss","Push","Half Win","Full Win"),IF(A1=B1,"Tie",IF(AND(SIGN(A1)=SIGN(B1),ABS(B1)>ABS(A1)),"Win","Loss")))
</edit>
 
Last edited:
Upvote 0
Wow thanks!
Not near excel at the moment but could someone with a knowledge of asian handicaps test it please?
 
Last edited:
Upvote 0
-3-2-10123
-3TieLossLossLossLossLossLoss
-2.75Half WinFull LossFull LossFull LossFull LossFull LossFull Loss
-2.5WinLossLossLossLossLossLoss
-2.25Full WinHalf LossFull LossFull LossFull LossFull LossFull Loss
-2WinTieLossLossLossLossLoss
-1.75Full WinHalf WinFull LossFull LossFull LossFull LossFull Loss
-1.5WinWinLossLossLossLossLoss
-1.25Full WinFull WinHalf LossFull LossFull LossFull LossFull Loss
-1WinWinTieLossLossLossLoss
-0.75Full WinFull WinHalf WinFull LossFull LossFull LossFull Loss
-0.5WinWinWinLossLossLossLoss
-0.25Full WinFull WinFull WinHalf LossFull LossFull LossFull Loss
0LossLossLossTieLossLossLoss
0.25Full LossFull LossFull LossHalf LossFull WinFull WinFull Win
0.5LossLossLossLossWinWinWin
0.75Full LossFull LossFull LossFull LossHalf WinFull WinFull Win
1LossLossLossLossTieWinWin
1.25Full LossFull LossFull LossFull LossHalf LossFull WinFull Win
1.5LossLossLossLossLossWinWin
1.75Full LossFull LossFull LossFull LossFull LossHalf WinFull Win
2LossLossLossLossLossTieWin
2.25Full LossFull LossFull LossFull LossFull LossHalf LossFull Win
2.5LossLossLossLossLossLossWin
2.75Full LossFull LossFull LossFull LossFull LossFull LossHalf Win
3LossLossLossLossLossLossTie

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,120
Members
451,399
Latest member
alchavar

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