Okay, so this is almost a math question as much as a computer programming question. I'm thinking the math should be easy, but setting the formula is tripping me up.
I have an excel spreadsheet of football teams/stats/scores, etc. In the second sheet, I lay each matchup for the week and the sheet lays out the Upper Quartile and Lower Quartile that each team could probably score. Add in the current casino line (yes, its probability team A beats B after points are given/taken), and the spreadsheet will give results such as:
Team - UQ - LQ A..... -32-20 B..... -35-23 Betting line, team A, +3
Now, assuming 50% of each teams score fits within its Upper to Lower quartiles, looking at this example, the result would be 50% probability (I'm not great at statistics, but it seems so to me) that team A wins, 50% team B wins (given that the range of quartiles after betting line is added becomes equal). The basic question is: how does one mathematically get that number? There are scenarios where the math I've come up with gets all messed up, I'll example some below:
A... 21-16 B... 19-13 Line +4
This should return 100%, given that after the line is added, 100% of team A's values are above B's values
A... 27-17 B... 31-12 Line -3
Now we subtract the line from team A's score and we get some outputs where B will always win/never win/might win. This would seem a less than 50% chance a random score from team A will be higher than a random score from team B. How would all these be calculated? Is there an easy enough way, given this information, to write a one line math formula to figure it out?
Sorry I can be long winded-but thank you for getting this far, all help is appreciated.