Hello, I would like to ask for a help with a simple algorithm I need to introduce. In the attached excel file there is a set of data with following notation:
Green cells - a line or total set by market
Yellow cells - a projected line or total
Blue cells - a final result or line - if positive value - home team (C column) lost, if negative - dome team won
Grey cells - a line or total difference (>=5 [5,6,7...999], >=7 [7,8,9...999], >=10 [10,11,12...999]) between line/total set by market and projected line/total
Red cells - cells that should contain the algorithm
Algorithm desrciption:
If the line/total difference (grey) is higher or equal to 5, the algorithm decides if projected line/total (yellow) beat the line set by market (green) comparing to the final result line/total (blue). If projected line/total beat the market line comparing to final result line/total, the algorithm should put W to the cells colored in red and the cell with W should be colored in green. If the projected line/total didnt beat the market line/total, it should put L to the cells colored in red and the cell with L should be colored in red. If neither projected or market line/total estimated final result line/total, it should put N to the cells colored in blue.
Example 1:
Game A
Market line - -5 (predicts home team to win by 5)
Projected line - -11 (predicts home team to win by 11)
Line difference is >=5
Final result - -6 (home team won by 6)
Even though market line -5 is closer to the final result -6 than predicted line -11, it should be marked as a W (with the cell colored in green) because it correctly predicted that -5 was too low regardless if the predicted line was -11 or -90.
Example 2:
Game B
Market line - 8 (predicts home team to lose by 8)
Projected line - 1 (predicts home team to lose by 1)
Line difference is >=5
Final result - 2 (home team lost by 2)
Even though the market line 8 is further away from the final result 2 than predicted line 1, it should be marked as a L (with the cell colored in red) because it incorrectly predicted that 8 was too high regardless if the predicted line was 1 or -10
Example 3:
Game C
Market line - -5 (predicts home team to win by 5)
Projected line - -11 (predicts home team to win by 11)
Line difference is >=5
Final result - 10 (home team lost by 10)
It should be marked as N (with the cell colored in blue) because neither market line or projected line predicted that home team would lost
Example 4:
Game D
Market line - -5 (predicts home team to win by 5)
Projected line - 3 (predicts home team to lose by 3)
Line difference is >=5
Final result - -3 (home team won by 3)
Even though market line -5 is closer to the final result line -3 than predicted line 3, it should be marked as a W (with the cell colored in green) because it correctly predicted that -5 was too high regardless if the predicted line was 3 or 90.
The same set of examples goes for totals.
I am not able to get this job done by simple functions and I would like to ask for a help to determine if this can be done by simple functions or some macro needs to be implemented. Thank you.
Hi, I reduced the file and added the described examples for line algorithm, however, I didn't add examples for totals because the logic is same. Only difference is that market total and projected total cannot be of negative value. I hope it is understandable.
Bookmarks