Need VBA Code for "permutations" and probablities

TheRinger

New Member
Joined
Dec 27, 2009
Messages
20
Here is what i have and have wrote these formulas all the way to the 9th horse winning. Yea 3078 combinations and don't look forward to doing the remaining combinations. I'm Hoping someone could help me by sharing some code that would calculate this for me without writing another 3762 formulas. I hope my table below explains it well enough. I enter ratings on each entrant and have formulas that give me each entrants probability. From these probabilities the formulas shown Known as the harville formula gives me the permutations(Trifecta) winning probability.


<tbody>
[TD="class: xl94"]Betting Number[/TD]
[TD="class: xl87"]My Rating[/TD]
[TD="class: xl87"]My Win Odds[/TD]
[TD="class: xl87"]My Win Probability[/TD]
[TD="class: xl95, width: 78"]Permutation
Combination[/TD]
[TD="class: xl96, width: 81"]Permutation Probability[/TD]
[TD="class: xl91, width: 194"]Formula used for each Permutation[/TD]

[TD="class: xl66"]1[/TD]
[TD="class: xl83"]90[/TD]
[TD="class: xl68"]3.91[/TD]
[TD="class: xl69"]20.37%[/TD]
[TD="class: xl85"]1-2-3[/TD]
[TD="class: xl86"]0.008%[/TD]
[TD="class: xl92"]IF(ISNUMBER($E$4*($E$5/(1-$E$4))*(E6/(1-($E$4+$E$5)))),($E$4*($E$5/(1-$E$4))*(E6/(1-($E$4+$E$5)))),"-")[/TD]

[TD="class: xl65"]2[/TD]
[TD="class: xl82"]65[/TD]
[TD="class: xl68"]72.25[/TD]
[TD="class: xl81"]1.37%[/TD]
[TD="class: xl85"]1-2-4[/TD]
[TD="class: xl86"]0.056%[/TD]
[TD="class: xl92"]IF(ISNUMBER($E$4*($E$5/(1-$E$4))*(E7/(1-($E$4+$E$5)))),($E$4*($E$5/(1-$E$4))*(E7/(1-($E$4+$E$5)))),"-")[/TD]

[TD="class: xl71"]3[/TD]
[TD="class: xl83"]67[/TD]
[TD="class: xl68"]57.21[/TD]
[TD="class: xl69"]1.72%[/TD]
[TD="class: xl85"]1-2-5[/TD]
[TD="class: xl86"]0.030%[/TD]
[TD="class: xl92"]IF(ISNUMBER($E$4*($E$5/(1-$E$4))*(E8/(1-($E$4+$E$5)))),($E$4*($E$5/(1-$E$4))*(E7/(1-($E$4+$E$5)))),"-")[/TD]

[TD="class: xl70"]4[/TD]
[TD="class: xl82"]85[/TD]
[TD="class: xl68"]7.01[/TD]
[TD="class: xl81"]12.49%[/TD]
[TD="class: xl84"]1-2-ETC[/TD]
[TD="class: xl88"]ETC[/TD]
[TD="class: xl92"]ETC[/TD]

[TD="class: xl73"]5[/TD]
[TD="class: xl83"]79[/TD]
[TD="class: xl68"]14.11[/TD]
[TD="class: xl69"]6.62%[/TD]
[TD="class: xl85"]2-1-3[/TD]
[TD="class: xl86"]0.006%[/TD]
[TD="class: xl92"]IF(ISNUMBER($E$5*($E$4/(1-$E$5))*(E6/(1-($E$5+$E$4)))),($E$5*($E$4/(1-$E$5))*(E6/(1-($E$5+$E$4)))),"-")[/TD]

[TD="class: xl72"]6[/TD]
[TD="class: xl82"]67[/TD]
[TD="class: xl68"]57.21[/TD]
[TD="class: xl81"]1.72%[/TD]
[TD="class: xl85"]2-1-4[/TD]
[TD="class: xl86"]0.045%[/TD]
[TD="class: xl92"]IF(ISNUMBER($E$5*($E$4/(1-$E$5))*(E7/(1-($E$5+$E$4)))),($E$5*($E$4/(1-$E$5))*(E6/(1-($E$5+$E$4)))),"-")[/TD]

[TD="class: xl75"]7[/TD]
[TD="class: xl83"]88[/TD]
[TD="class: xl68"]4.94[/TD]
[TD="class: xl69"]16.84%[/TD]
[TD="class: xl85"]2-1-5[/TD]
[TD="class: xl86"]0.024%[/TD]
[TD="class: xl92"]IF(ISNUMBER($E$5*($E$4/(1-$E$5))*(E8/(1-($E$5+$E$4)))),($E$5*($E$4/(1-$E$5))*(E6/(1-($E$5+$E$4)))),"-")[/TD]

[TD="class: xl74"]8[/TD]
[TD="class: xl82"]83[/TD]
[TD="class: xl68"]8.85[/TD]
[TD="class: xl81"]10.15%[/TD]
[TD="class: xl84"]2-1-ETC[/TD]
[TD="class: xl88"]ETC[/TD]
[TD="class: xl92"]ETC[/TD]

[TD="class: xl77"]9[/TD]
[TD="class: xl83"]80[/TD]
[TD="class: xl68"]12.56[/TD]
[TD="class: xl69"]7.38%[/TD]
[TD="class: xl85"]3-1-2[/TD]
[TD="class: xl86"]0.006%[/TD]
[TD="class: xl92"]IF(ISNUMBER($E$6*($E$4/(1-$E$6))*(E5/(1-($E$6+$E$4)))),($E$6*($E$4/(1-$E$6))*(E5/(1-($E$6+$E$4)))),"-")[/TD]

[TD="class: xl76"]10[/TD]
[TD="class: xl82"]77[/TD]
[TD="class: xl68"]17.82[/TD]
[TD="class: xl81"]5.31%[/TD]
[TD="class: xl85"]3-1-4[/TD]
[TD="class: xl86"]0.057%[/TD]
[TD="class: xl92"]IF(ISNUMBER($E$6*($E$4/(1-$E$6))*(E7/(1-($E$6+$E$4)))),($E$6*($E$4/(1-$E$6))*(E5/(1-($E$6+$E$4)))),"-")[/TD]

[TD="class: xl79"]11[/TD]
[TD="class: xl83"]73[/TD]
[TD="class: xl68"]28.41[/TD]
[TD="class: xl69"]3.40%[/TD]
[TD="class: xl85"]3-1-5[/TD]
[TD="class: xl86"]0.030%[/TD]
[TD="class: xl92"]IF(ISNUMBER($E$6*($E$4/(1-$E$6))*(E8/(1-($E$6+$E$4)))),($E$6*($E$4/(1-$E$6))*(E5/(1-($E$6+$E$4)))),"-")[/TD]

[TD="class: xl78"]12[/TD]
[TD="class: xl82"]85[/TD]
[TD="class: xl68"]7.01[/TD]
[TD="class: xl81"]12.49%[/TD]
[TD="class: xl93"]20-19-18[/TD]
[TD="class: xl90"]ETC[/TD]

</tbody>
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
I got the input data and the formula you have used? What is the problem with formula? Why you can't use it for whole range as you can just drag or customize the formula to fit your whole data. Would you please explain in more detail.
 
Upvote 0
<!--[if gte mso 9]><xml> <o:OfficeDocumentSettings> <o:AllowPNG/> </o:OfficeDocumentSettings> </xml><![endif]--> Hello Meesam. To answer your question, one reason is it very time consuming to customize formula in each cell and fill down a few rows and repeat. Second reason for code if written correctly there is less chance of errors. Third reason code is “cleaner”, less cumbersome and faster. I noticed the above example formulas have errors in them. Permutation Combination 1-2-5 has the following error(in bold) IF(ISNUMBER($E$4*($E$5/(1-$E$4))*(E8/(1-($E$4+$E$5)))),($E$4*($E$5/(1-$E$4))*(E8/(1-($E$4+$E$5)))),"-"). Combinations 2-1-4, 2-1-5, 3-1-4 and 3-1-5 all have the same error. This is my main concern with customizing each of the 6840 combinations. I will continue to manually do it and will also have to figure out a way to find errors if any.
<!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:TrackMoves/> <w:TrackFormatting/> <w:PunctuationKerning/> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:DoNotPromoteQF/> <w:LidThemeOther>EN-US</w:LidThemeOther> <w:LidThemeAsian>X-NONE</w:LidThemeAsian> <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> <w:SplitPgBreakAndParaMark/> <w:EnableOpenTypeKerning/> <w:DontFlipMirrorIndents/> <w:OverrideTableStyleHps/> </w:Compatibility> <m:mathPr> <m:mathFont m:val="Cambria Math"/> <m:brkBin m:val="before"/> <m:brkBinSub m:val="--"/> <m:smallFrac m:val="off"/> <m:dispDef/> <m:lMargin m:val="0"/> <m:rMargin m:val="0"/> <m:defJc m:val="centerGroup"/> <m:wrapIndent m:val="1440"/> <m:intLim m:val="subSup"/> <m:naryLim m:val="undOvr"/> </m:mathPr></w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true" DefSemiHidden="true" DefQFormat="false" DefPriority="99" LatentStyleCount="267"> <w:LsdException Locked="false" Priority="0" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Normal"/> <w:LsdException Locked="false" Priority="9" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="heading 1"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/> <w:LsdException Locked="false" Priority="39" Name="toc 1"/> <w:LsdException Locked="false" Priority="39" Name="toc 2"/> <w:LsdException Locked="false" Priority="39" Name="toc 3"/> <w:LsdException Locked="false" Priority="39" Name="toc 4"/> <w:LsdException Locked="false" Priority="39" Name="toc 5"/> <w:LsdException Locked="false" Priority="39" Name="toc 6"/> <w:LsdException Locked="false" Priority="39" Name="toc 7"/> <w:LsdException Locked="false" Priority="39" Name="toc 8"/> <w:LsdException Locked="false" Priority="39" Name="toc 9"/> <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/> <w:LsdException Locked="false" Priority="10" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Title"/> <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/> <w:LsdException Locked="false" Priority="11" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/> <w:LsdException Locked="false" Priority="22" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Strong"/> <w:LsdException Locked="false" Priority="20" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/> <w:LsdException Locked="false" Priority="59" SemiHidden="false" UnhideWhenUsed="false" Name="Table Grid"/> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/> <w:LsdException Locked="false" Priority="1" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 1"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 1"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 1"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/> <w:LsdException Locked="false" Priority="34" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/> <w:LsdException Locked="false" Priority="29" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Quote"/> <w:LsdException Locked="false" Priority="30" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 1"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 1"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 2"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 2"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 2"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 2"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 2"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 3"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 3"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 3"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 3"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 3"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 4"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 4"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 4"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 4"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 4"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 5"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 5"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 5"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 5"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 5"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 6"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 6"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 6"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 6"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 6"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/> <w:LsdException Locked="false" Priority="19" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/> <w:LsdException Locked="false" Priority="21" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/> <w:LsdException Locked="false" Priority="31" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/> <w:LsdException Locked="false" Priority="32" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/> <w:LsdException Locked="false" Priority="33" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Book Title"/> <w:LsdException Locked="false" Priority="37" Name="Bibliography"/> <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/> </w:LatentStyles> </xml><![endif]--><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;} </style> <![endif]-->
 
Upvote 0
Can you please help me understand the formula? Developing a code for simple formula entry is super easy but the point here is what is your code trying to achieve and what is formula in terms of general layman sense (I mean what multiplies by what to get answer)? Will then automate it using vba.
 
Upvote 0
<!--[if gte mso 9]><xml> <o:OfficeDocumentSettings> <o:AllowPNG/> </o:OfficeDocumentSettings> </xml><![endif]--> Hello Meesam. Sorry for the delay in reply. The chart below shows an extremely exaggerated example of the end goal. As the wagers become more complex the more inefficient they become. While the public estimates of win and exacta payoffs are posted, Place, Show and Trifecta estimates must be calculated with the pools. The formula to calculate the Trifecta is below:
WinProb#1*(WinProb#2/(1-WinProb#1))*(WinProb#3/(1-(WinProb#1+WinProb#2)))

OR

Winner*(placer/(1-Winner))*(Shower/(1-(Winner+placer)))



<tbody>
[TD="class: xl91, colspan: 4"]My Estimate of Probabilities[/TD]
[TD="class: xl119, colspan: 6"]Public's Estimate of Probabilities (NO TAKEOUT)[/TD]
[TD="class: xl83, width: 137, colspan: 2"]Possible Bets[/TD]

[TD="class: xl96, width: 55"]horse number[/TD]
[TD="class: xl97, width: 60"]100% Win prob[/TD]
[TD="class: xl98, width: 57"]$2 fair payoff[/TD]
[TD="class: xl99, width: 49"]100% odds[/TD]

[TD="class: xl94, width: 56"]horse number[/TD]
[TD="class: xl117, width: 60"]100% Win prob[/TD]
[TD="class: xl118, width: 57"]$2 fair payoff[/TD]
[TD="class: xl95, width: 42"]100% odds[/TD]
[TD="class: xl106, width: 26"][/TD]
[TD="class: xl96, width: 55"]horse number[/TD]
[TD="class: xl111"]Expectation[/TD]

[TD="class: xl88, align: right"]1[/TD]
[TD="class: xl85, align: right"]33.000%[/TD]
[TD="class: xl86"] $ 6.06[/TD]
[TD="class: xl89, align: right"]2.03[/TD]

[TD="class: xl88, align: right"]1[/TD]
[TD="class: xl85, align: right"]22.000%[/TD]
[TD="class: xl86"] $ 9.09[/TD]
[TD="class: xl89, align: right"]3.55[/TD]
[TD="class: xl104"][/TD]
[TD="class: xl88, align: right"]1[/TD]
[TD="class: xl115"]0.50[/TD]

[TD="class: xl88, align: right"]2[/TD]
[TD="class: xl85, align: right"]22.000%[/TD]
[TD="class: xl86"] $ 9.09[/TD]
[TD="class: xl89, align: right"]3.55[/TD]

[TD="class: xl88, align: right"]2[/TD]
[TD="class: xl85, align: right"]33.000%[/TD]
[TD="class: xl86"] $ 6.06[/TD]
[TD="class: xl89, align: right"]2.03[/TD]
[TD="class: xl104"][/TD]
[TD="class: xl88, align: right"]2[/TD]
[TD="class: xl115"]-0.33[/TD]

[TD="class: xl88, align: right"]3[/TD]
[TD="class: xl85, align: right"]28.000%[/TD]
[TD="class: xl86"] $ 7.14[/TD]
[TD="class: xl89, align: right"]2.57[/TD]

[TD="class: xl88, align: right"]3[/TD]
[TD="class: xl85, align: right"]28.000%[/TD]
[TD="class: xl86"] $ 7.14[/TD]
[TD="class: xl89, align: right"]2.57[/TD]
[TD="class: xl104"][/TD]
[TD="class: xl88, align: right"]3[/TD]
[TD="class: xl115"]0.00[/TD]

[TD="class: xl88, align: right"]4[/TD]
[TD="class: xl85, align: right"]17.000%[/TD]
[TD="class: xl86"] $11.76[/TD]
[TD="class: xl89, align: right"]4.88[/TD]

[TD="class: xl88, align: right"]4[/TD]
[TD="class: xl85, align: right"]17.000%[/TD]
[TD="class: xl86"] $11.76[/TD]
[TD="class: xl89, align: right"]4.88[/TD]
[TD="class: xl104"][/TD]
[TD="class: xl88, align: right"]4[/TD]
[TD="class: xl115"]0.00[/TD]

[TD="class: xl90"][/TD]
[TD="class: xl100, align: right"]100.00%[/TD]
[TD="class: xl101"][/TD]
[TD="class: xl102"][/TD]

[TD="class: xl90"][/TD]
[TD="class: xl100, align: right"]100.00%[/TD]
[TD="class: xl101"][/TD]
[TD="class: xl102"][/TD]
[TD="class: xl105"][/TD]
[TD="class: xl88"][/TD]
[TD="class: xl115"][/TD]

[TD="class: xl66, width: 55"]trifecta combo[/TD]
[TD="class: xl67, width: 60"]trifecta win %[/TD]
[TD="class: xl68, width: 57"]$2 fair pay[/TD]
[TD="class: xl75, width: 49"]100% odds[/TD]

[TD="class: xl66, width: 56"]trifecta combo[/TD]
[TD="class: xl67, width: 60"]trifecta win %[/TD]
[TD="class: xl68, width: 57"]$2 fair pay[/TD]
[TD="class: xl75, width: 42"]100% odds[/TD]
[TD="class: xl74, width: 26"][/TD]
[TD="class: xl87, width: 55"]trifecta combo[/TD]
[TD="class: xl115"][/TD]

[TD="class: xl69"]1-2-3[/TD]
[TD="class: xl70, align: right"]6.742%[/TD]
[TD="class: xl71, align: right"]$29.66[/TD]
[TD="class: xl103, align: right"]13.83[/TD]

[TD="class: xl69"]1-2-3[/TD]
[TD="class: xl70, align: right"]5.791%[/TD]
[TD="class: xl71, align: right"]$34.53[/TD]
[TD="class: xl103, align: right"]16.27[/TD]
[TD="class: xl109"][/TD]
[TD="class: xl113"]1-2-3[/TD]
[TD="class: xl115"]0.16[/TD]

[TD="class: xl69"]1-2-4[/TD]
[TD="class: xl70, align: right"]4.094%[/TD]
[TD="class: xl71, align: right"]$48.86[/TD]
[TD="class: xl103, align: right"]23.43[/TD]

[TD="class: xl69"]1-2-4[/TD]
[TD="class: xl70, align: right"]3.516%[/TD]
[TD="class: xl71, align: right"]$56.88[/TD]
[TD="class: xl103, align: right"]27.44[/TD]
[TD="class: xl109"][/TD]
[TD="class: xl113"]1-2-4[/TD]
[TD="class: xl115"]0.16[/TD]

[TD="class: xl69"]1-3-2[/TD]
[TD="class: xl70, align: right"]7.780%[/TD]
[TD="class: xl71, align: right"]$25.71[/TD]
[TD="class: xl103, align: right"]11.85[/TD]

[TD="class: xl69"]1-3-2[/TD]
[TD="class: xl70, align: right"]5.212%[/TD]
[TD="class: xl71, align: right"]$38.37[/TD]
[TD="class: xl103, align: right"]18.19[/TD]
[TD="class: xl109"][/TD]
[TD="class: xl113"]1-3-2[/TD]
[TD="class: xl115"]0.49[/TD]

[TD="class: xl69"]1-3-4[/TD]
[TD="class: xl70, align: right"]6.011%[/TD]
[TD="class: xl71, align: right"]$33.27[/TD]
[TD="class: xl103, align: right"]15.63[/TD]

[TD="class: xl69"]1-3-4[/TD]
[TD="class: xl70, align: right"]2.685%[/TD]
[TD="class: xl71, align: right"]$74.48[/TD]
[TD="class: xl103, align: right"]36.24[/TD]
[TD="class: xl109"][/TD]
[TD="class: xl113"]1-3-4[/TD]
[TD="class: xl115"]1.24[/TD]

[TD="class: xl69"]1-4-2[/TD]
[TD="class: xl70, align: right"]3.684%[/TD]
[TD="class: xl71, align: right"]$54.29[/TD]
[TD="class: xl103, align: right"]26.14[/TD]

[TD="class: xl69"]1-4-2[/TD]
[TD="class: xl70, align: right"]2.594%[/TD]
[TD="class: xl71, align: right"]$77.10[/TD]
[TD="class: xl103, align: right"]37.55[/TD]
[TD="class: xl109"][/TD]
[TD="class: xl113"]1-4-2[/TD]
[TD="class: xl115"]0.42[/TD]

[TD="class: xl69"]1-4-3[/TD]
[TD="class: xl70, align: right"]4.689%[/TD]
[TD="class: xl71, align: right"]$42.65[/TD]
[TD="class: xl103, align: right"]20.33[/TD]

[TD="class: xl69"]1-4-3[/TD]
[TD="class: xl70, align: right"]2.201%[/TD]
[TD="class: xl71, align: right"]$90.87[/TD]
[TD="class: xl103, align: right"]44.44[/TD]
[TD="class: xl109"][/TD]
[TD="class: xl113"]1-4-3[/TD]
[TD="class: xl115"]1.13[/TD]

[TD="class: xl73"][/TD]
[TD="class: xl78, align: right"]33.000%[/TD]
[TD="class: xl79"][/TD]
[TD="class: xl82"][/TD]

[TD="class: xl73"][/TD]
[TD="class: xl78, align: right"]22.000%[/TD]
[TD="class: xl79"][/TD]
[TD="class: xl82"][/TD]
[TD="class: xl108"][/TD]
[TD="class: xl112"][/TD]
[TD="class: xl115"][/TD]

[TD="class: xl66, width: 55"]trifecta combo[/TD]
[TD="class: xl67, width: 60"]trifecta win %[/TD]
[TD="class: xl68, width: 57"]$2 fair pay[/TD]
[TD="class: xl75, width: 49"]100% odds[/TD]

[TD="class: xl66, width: 56"]trifecta combo[/TD]
[TD="class: xl67, width: 60"]trifecta win %[/TD]
[TD="class: xl68, width: 57"]$2 fair pay[/TD]
[TD="class: xl75, width: 42"]100% odds[/TD]
[TD="class: xl74, width: 26"][/TD]
[TD="class: xl87, width: 55"]trifecta combo[/TD]
[TD="class: xl115"][/TD]

[TD="class: xl69"]2-1-3[/TD]
[TD="class: xl70, align: right"]5.791%[/TD]
[TD="class: xl71, align: right"]$34.53[/TD]
[TD="class: xl76, align: right"]16.27[/TD]

[TD="class: xl69"]2-1-3[/TD]
[TD="class: xl70, align: right"]6.742%[/TD]
[TD="class: xl71, align: right"]$29.66[/TD]
[TD="class: xl76, align: right"]13.83[/TD]
[TD="class: xl107"][/TD]
[TD="class: xl113"]2-1-3[/TD]
[TD="class: xl115"]-0.14[/TD]

[TD="class: xl69"]2-1-4[/TD]
[TD="class: xl70, align: right"]3.516%[/TD]
[TD="class: xl71, align: right"]$56.88[/TD]
[TD="class: xl76, align: right"]27.44[/TD]

[TD="class: xl69"]2-1-4[/TD]
[TD="class: xl70, align: right"]4.094%[/TD]
[TD="class: xl71, align: right"]$48.86[/TD]
[TD="class: xl76, align: right"]23.43[/TD]
[TD="class: xl107"][/TD]
[TD="class: xl113"]2-1-4[/TD]
[TD="class: xl115"]-0.14[/TD]

[TD="class: xl69"]2-3-1[/TD]
[TD="class: xl70, align: right"]5.212%[/TD]
[TD="class: xl71, align: right"]$38.37[/TD]
[TD="class: xl76, align: right"]18.19[/TD]

[TD="class: xl69"]2-3-1[/TD]
[TD="class: xl70, align: right"]7.780%[/TD]
[TD="class: xl71, align: right"]$25.71[/TD]
[TD="class: xl76, align: right"]11.85[/TD]
[TD="class: xl107"][/TD]
[TD="class: xl113"]2-3-1[/TD]
[TD="class: xl115"]-0.33[/TD]

[TD="class: xl69"]2-3-4[/TD]
[TD="class: xl70, align: right"]2.685%[/TD]
[TD="class: xl71, align: right"]$74.48[/TD]
[TD="class: xl76, align: right"]36.24[/TD]

[TD="class: xl69"]2-3-4[/TD]
[TD="class: xl70, align: right"]6.011%[/TD]
[TD="class: xl71, align: right"]$33.27[/TD]
[TD="class: xl76, align: right"]15.63[/TD]
[TD="class: xl107"][/TD]
[TD="class: xl113"]2-3-4[/TD]
[TD="class: xl115"]-0.55[/TD]

[TD="class: xl69"]2-4-1[/TD]
[TD="class: xl70, align: right"]2.594%[/TD]
[TD="class: xl71, align: right"]$77.10[/TD]
[TD="class: xl76, align: right"]37.55[/TD]

[TD="class: xl69"]2-4-1[/TD]
[TD="class: xl70, align: right"]3.684%[/TD]
[TD="class: xl71, align: right"]$54.29[/TD]
[TD="class: xl76, align: right"]26.14[/TD]
[TD="class: xl107"][/TD]
[TD="class: xl113"]2-4-1[/TD]
[TD="class: xl115"]-0.30[/TD]

[TD="class: xl69"]2-4-3[/TD]
[TD="class: xl70, align: right"]2.201%[/TD]
[TD="class: xl71, align: right"]$90.87[/TD]
[TD="class: xl76, align: right"]44.44[/TD]

[TD="class: xl69"]2-4-3[/TD]
[TD="class: xl70, align: right"]4.689%[/TD]
[TD="class: xl71, align: right"]$42.65[/TD]
[TD="class: xl76, align: right"]20.33[/TD]
[TD="class: xl107"][/TD]
[TD="class: xl113"]2-4-3[/TD]
[TD="class: xl115"]-0.53[/TD]

[TD="class: xl81"][/TD]
[TD="class: xl78, align: right"]22.000%[/TD]
[TD="class: xl80"][/TD]
[TD="class: xl82"][/TD]

[TD="class: xl81"][/TD]
[TD="class: xl78, align: right"]33.000%[/TD]
[TD="class: xl80"][/TD]
[TD="class: xl82"][/TD]
[TD="class: xl108"][/TD]
[TD="class: xl114"][/TD]
[TD="class: xl115"][/TD]

[TD="class: xl66, width: 55"]trifecta combo[/TD]
[TD="class: xl67, width: 60"]trifecta win %[/TD]
[TD="class: xl68, width: 57"]$2 fair pay[/TD]
[TD="class: xl75, width: 49"]100% odds[/TD]

[TD="class: xl66, width: 56"]trifecta combo[/TD]
[TD="class: xl67, width: 60"]trifecta win %[/TD]
[TD="class: xl68, width: 57"]$2 fair pay[/TD]
[TD="class: xl75, width: 42"]100% odds[/TD]
[TD="class: xl74, width: 26"][/TD]
[TD="class: xl87, width: 55"]trifecta combo[/TD]
[TD="class: xl115"][/TD]

[TD="class: xl69"]3-1-2[/TD]
[TD="class: xl70, align: right"]7.239%[/TD]
[TD="class: xl71, align: right"]$27.63[/TD]
[TD="class: xl76, align: right"]12.81[/TD]

[TD="class: xl69"]3-1-2[/TD]
[TD="class: xl70, align: right"]5.647%[/TD]
[TD="class: xl71, align: right"]$35.42[/TD]
[TD="class: xl76, align: right"]16.71[/TD]
[TD="class: xl107"][/TD]
[TD="class: xl113"]3-1-2[/TD]
[TD="class: xl115"]0.28[/TD]

[TD="class: xl69"]3-1-4[/TD]
[TD="class: xl70, align: right"]5.594%[/TD]
[TD="class: xl71, align: right"]$35.75[/TD]
[TD="class: xl76, align: right"]16.88[/TD]

[TD="class: xl69"]3-1-4[/TD]
[TD="class: xl70, align: right"]2.909%[/TD]
[TD="class: xl71, align: right"]$68.75[/TD]
[TD="class: xl76, align: right"]33.38[/TD]
[TD="class: xl107"][/TD]
[TD="class: xl113"]3-1-4[/TD]
[TD="class: xl115"]0.92[/TD]

[TD="class: xl69"]3-2-1[/TD]
[TD="class: xl70, align: right"]5.647%[/TD]
[TD="class: xl71, align: right"]$35.42[/TD]
[TD="class: xl76, align: right"]16.71[/TD]

[TD="class: xl69"]3-2-1[/TD]
[TD="class: xl70, align: right"]7.239%[/TD]
[TD="class: xl71, align: right"]$27.63[/TD]
[TD="class: xl76, align: right"]12.81[/TD]
[TD="class: xl107"][/TD]
[TD="class: xl113"]3-2-1[/TD]
[TD="class: xl115"]-0.22[/TD]

[TD="class: xl69"]3-2-4[/TD]
[TD="class: xl70, align: right"]2.909%[/TD]
[TD="class: xl71, align: right"]$68.75[/TD]
[TD="class: xl76, align: right"]33.38[/TD]

[TD="class: xl69"]3-2-4[/TD]
[TD="class: xl70, align: right"]5.594%[/TD]
[TD="class: xl71, align: right"]$35.75[/TD]
[TD="class: xl76, align: right"]16.88[/TD]
[TD="class: xl107"][/TD]
[TD="class: xl113"]3-2-4[/TD]
[TD="class: xl115"]-0.48[/TD]

[TD="class: xl69"]3-4-1[/TD]
[TD="class: xl70, align: right"]3.967%[/TD]
[TD="class: xl71, align: right"]$50.42[/TD]
[TD="class: xl76, align: right"]24.21[/TD]

[TD="class: xl69"]3-4-1[/TD]
[TD="class: xl70, align: right"]2.644%[/TD]
[TD="class: xl71, align: right"]$75.63[/TD]
[TD="class: xl76, align: right"]36.82[/TD]
[TD="class: xl107"][/TD]
[TD="class: xl113"]3-4-1[/TD]
[TD="class: xl115"]0.50[/TD]

[TD="class: xl69"]3-4-2[/TD]
[TD="class: xl70, align: right"]2.644%[/TD]
[TD="class: xl71, align: right"]$75.63[/TD]
[TD="class: xl76, align: right"]36.82[/TD]

[TD="class: xl69"]3-4-2[/TD]
[TD="class: xl70, align: right"]3.967%[/TD]
[TD="class: xl71, align: right"]$50.42[/TD]
[TD="class: xl76, align: right"]24.21[/TD]
[TD="class: xl107"][/TD]
[TD="class: xl113"]3-4-2[/TD]
[TD="class: xl115"]-0.33[/TD]

[TD="class: xl73"][/TD]
[TD="class: xl78, align: right"]28.000%[/TD]
[TD="class: xl79"][/TD]
[TD="class: xl82"][/TD]

[TD="class: xl73"][/TD]
[TD="class: xl78, align: right"]28.000%[/TD]
[TD="class: xl79"][/TD]
[TD="class: xl82"][/TD]
[TD="class: xl108"][/TD]
[TD="class: xl112"][/TD]
[TD="class: xl115"][/TD]

[TD="class: xl66, width: 55"]trifecta combo[/TD]
[TD="class: xl67, width: 60"]trifecta win %[/TD]
[TD="class: xl68, width: 57"]$2 fair pay[/TD]
[TD="class: xl75, width: 49"]100% odds[/TD]

[TD="class: xl66, width: 56"]trifecta combo[/TD]
[TD="class: xl67, width: 60"]trifecta win %[/TD]
[TD="class: xl68, width: 57"]$2 fair pay[/TD]
[TD="class: xl75, width: 42"]100% odds[/TD]
[TD="class: xl74, width: 26"][/TD]
[TD="class: xl87, width: 55"]trifecta combo[/TD]
[TD="class: xl115"][/TD]

[TD="class: xl69"]4-1-2[/TD]
[TD="class: xl70, align: right"]2.974%[/TD]
[TD="class: xl71, align: right"]$67.25[/TD]
[TD="class: xl76, align: right"]32.63[/TD]

[TD="class: xl69"]4-1-2[/TD]
[TD="class: xl70, align: right"]2.438%[/TD]
[TD="class: xl71, align: right"]$82.05[/TD]
[TD="class: xl76, align: right"]40.02[/TD]
[TD="class: xl107"][/TD]
[TD="class: xl113"]4-1-2[/TD]
[TD="class: xl115"]0.22[/TD]

[TD="class: xl69"]4-1-3[/TD]
[TD="class: xl70, align: right"]3.785%[/TD]
[TD="class: xl71, align: right"]$52.84[/TD]
[TD="class: xl76, align: right"]25.42[/TD]

[TD="class: xl69"]4-1-3[/TD]
[TD="class: xl70, align: right"]2.068%[/TD]
[TD="class: xl71, align: right"]$96.70[/TD]
[TD="class: xl76, align: right"]47.35[/TD]
[TD="class: xl107"][/TD]
[TD="class: xl113"]4-1-3[/TD]
[TD="class: xl115"]0.83[/TD]

[TD="class: xl69"]4-2-1[/TD]
[TD="class: xl70, align: right"]2.438%[/TD]
[TD="class: xl71, align: right"]$82.05[/TD]
[TD="class: xl76, align: right"]40.02[/TD]

[TD="class: xl69"]4-2-1[/TD]
[TD="class: xl70, align: right"]2.974%[/TD]
[TD="class: xl71, align: right"]$67.25[/TD]
[TD="class: xl76, align: right"]32.63[/TD]
[TD="class: xl107"][/TD]
[TD="class: xl113"]4-2-1[/TD]
[TD="class: xl115"]-0.18[/TD]

[TD="class: xl69"]4-2-3[/TD]
[TD="class: xl70, align: right"]2.068%[/TD]
[TD="class: xl71, align: right"]$96.70[/TD]
[TD="class: xl76, align: right"]47.35[/TD]

[TD="class: xl69"]4-2-3[/TD]
[TD="class: xl70, align: right"]3.785%[/TD]
[TD="class: xl71, align: right"]$52.84[/TD]
[TD="class: xl76, align: right"]25.42[/TD]
[TD="class: xl107"][/TD]
[TD="class: xl113"]4-2-3[/TD]
[TD="class: xl115"]-0.45[/TD]

[TD="class: xl69"]4-3-1[/TD]
[TD="class: xl70, align: right"]3.441%[/TD]
[TD="class: xl71, align: right"]$58.12[/TD]
[TD="class: xl76, align: right"]28.06[/TD]

[TD="class: xl69"]4-3-1[/TD]
[TD="class: xl70, align: right"]2.294%[/TD]
[TD="class: xl71, align: right"]$87.18[/TD]
[TD="class: xl76, align: right"]42.59[/TD]
[TD="class: xl107"][/TD]
[TD="class: xl113"]4-3-1[/TD]
[TD="class: xl115"]0.50[/TD]

[TD="class: xl69"]4-3-2[/TD]
[TD="class: xl70, align: right"]2.294%[/TD]
[TD="class: xl71, align: right"]$87.18[/TD]
[TD="class: xl76, align: right"]42.59[/TD]

[TD="class: xl69"]4-3-2[/TD]
[TD="class: xl70, align: right"]3.441%[/TD]
[TD="class: xl71, align: right"]$58.12[/TD]
[TD="class: xl76, align: right"]28.06[/TD]
[TD="class: xl107"][/TD]
[TD="class: xl113"]4-3-2[/TD]
[TD="class: xl115"]-0.33[/TD]

[TD="class: xl81"][/TD]
[TD="class: xl78, align: right"]17.000%[/TD]
[TD="class: xl79"][/TD]
[TD="class: xl82"][/TD]
[TD="class: xl77"][/TD]
[TD="class: xl81"][/TD]
[TD="class: xl78, align: right"]17.000%[/TD]
[TD="class: xl79"][/TD]
[TD="class: xl82"][/TD]
[TD="class: xl77"][/TD]
[TD="class: xl90"][/TD]
[TD="class: xl116"][/TD]

</tbody>



<!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:TrackMoves/> <w:TrackFormatting/> <w:PunctuationKerning/> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:DoNotPromoteQF/> <w:LidThemeOther>EN-US</w:LidThemeOther> <w:LidThemeAsian>X-NONE</w:LidThemeAsian> <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> <w:SplitPgBreakAndParaMark/> <w:EnableOpenTypeKerning/> <w:DontFlipMirrorIndents/> <w:OverrideTableStyleHps/> </w:Compatibility> <m:mathPr> <m:mathFont m:val="Cambria Math"/> <m:brkBin m:val="before"/> <m:brkBinSub m:val="--"/> <m:smallFrac m:val="off"/> <m:dispDef/> <m:lMargin m:val="0"/> <m:rMargin m:val="0"/> <m:defJc m:val="centerGroup"/> <m:wrapIndent m:val="1440"/> <m:intLim m:val="subSup"/> <m:naryLim m:val="undOvr"/> </m:mathPr></w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true" DefSemiHidden="true" DefQFormat="false" DefPriority="99" LatentStyleCount="267"> <w:LsdException Locked="false" Priority="0" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Normal"/> <w:LsdException Locked="false" Priority="9" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="heading 1"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/> <w:LsdException Locked="false" Priority="39" Name="toc 1"/> <w:LsdException Locked="false" Priority="39" Name="toc 2"/> <w:LsdException Locked="false" Priority="39" Name="toc 3"/> <w:LsdException Locked="false" Priority="39" Name="toc 4"/> <w:LsdException Locked="false" Priority="39" Name="toc 5"/> <w:LsdException Locked="false" Priority="39" Name="toc 6"/> <w:LsdException Locked="false" Priority="39" Name="toc 7"/> <w:LsdException Locked="false" Priority="39" Name="toc 8"/> <w:LsdException Locked="false" Priority="39" Name="toc 9"/> <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/> <w:LsdException Locked="false" Priority="10" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Title"/> <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/> <w:LsdException Locked="false" Priority="11" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/> <w:LsdException Locked="false" Priority="22" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Strong"/> <w:LsdException Locked="false" Priority="20" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/> <w:LsdException Locked="false" Priority="59" SemiHidden="false" UnhideWhenUsed="false" Name="Table Grid"/> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/> <w:LsdException Locked="false" Priority="1" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 1"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 1"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 1"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/> <w:LsdException Locked="false" Priority="34" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/> <w:LsdException Locked="false" Priority="29" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Quote"/> <w:LsdException Locked="false" Priority="30" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 1"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 1"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 2"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 2"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 2"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 2"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 2"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 3"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 3"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 3"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 3"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 3"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 4"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 4"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 4"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 4"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 4"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 5"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 5"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 5"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 5"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 5"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 6"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 6"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 6"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 6"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 6"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/> <w:LsdException Locked="false" Priority="19" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/> <w:LsdException Locked="false" Priority="21" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/> <w:LsdException Locked="false" Priority="31" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/> <w:LsdException Locked="false" Priority="32" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/> <w:LsdException Locked="false" Priority="33" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Book Title"/> <w:LsdException Locked="false" Priority="37" Name="Bibliography"/> <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/> </w:LatentStyles> </xml><![endif]--><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;} </style> <![endif]-->
 
Last edited:
Upvote 0
Ok mate here is my first try. Please don't mind if the results don't match up. I am still trying to fully grasp the "logic" or formulae but I hope things move on well from here. Check the below code based on data of horses or "betting number" starting from cell b4 and the trifecta combo in column "f". Also it is assumed that "trifecta" is always given manual and with two hyphens between the three digits.
Code:
Sub HorseRace()
Dim rng1 As Range, rng2 As Range, rCell As Range, lastRow1 As Long, lastrRow2 As Long
Dim winner As String, placer As String, shower As String, rngHorse As Range
Dim rngFull As Range
Dim w1 As String, p1 As String, s1 As String
Dim w2 As Range, p2 As Range, s2 As Range
Dim w3 As Single, p3 As Single, s3 As Single


Set rng2 = ThisWorkbook.Sheets("result").Range("D65336").End(xlUp)
lastRow = ThisWorkbook.Sheets("input").Range("b4").End(xlDown).Row
Set rngHorse = ThisWorkbook.Sheets("input").Range("b4:b" & lastRow)
Set rng1 = ThisWorkbook.Sheets("input").Range("f4:f" & lastRow)
Set rngFull = ThisWorkbook.Sheets("input").Range("b4:h" & lastRow)
count = 0


For Each rCell In rng1
    'Parse the cell to get three components
    winner = makeParts(rCell.Value)(0)
    placer = makeParts(rCell.Value)(1)
    shower = makeParts(rCell.Value)(2)
    
    'check the probabilities using find function
        Set w2 = rngHorse.Find(winner, LookIn:=xlValues, lookat:=xlWhole)
            w1 = w2.Address
            w3 = Range(Replace(w1, "$", "")).Offset(0, 3).Value
        Set p2 = rngHorse.Find(placer, LookIn:=xlValues, lookat:=xlWhole)
            p1 = p2.Address
            p3 = Range(Replace(p1, "$", "")).Offset(0, 3).Value
        Set s2 = rngHorse.Find(shower, LookIn:=xlValues, lookat:=xlWhole)
            s1 = s2.Address
            s3 = Range(Replace(s1, "$", "")).Offset(0, 3).Value
    
    'Formula as given by Ringer to be placed in 3 columns offset
    rCell.Offset(0, 3).Value = w3 * ((p3 / (1 - w3))) * (s3 / (1 - (w3 + p3)))
    count = count + 1
Next rCell




End Sub


Function makeParts(valInput As String) As Variant()
  
  Dim Parts() As String
  Dim r1 As Integer, r2 As Integer, r3 As Integer
  
  On Error Resume Next
  Parts = Split(valInput, "-")
  r1 = Parts(0)
  r2 = Parts(1)
  r3 = Parts(2)
  makeParts = Array(r1, r2, r3)
  
End Function
 
Upvote 0
I have created a workbook with 2 worksheets. One is named Input and the other is result.
The Input sheet has this data in it. The result sheet is empty.

Cells B4 through B8 are the horse number.
Cells C4 through C8 are the Horse winning prob.
Cells D4 through D8 are the $2 fair payoff.
Cells E4 through E8 are The 100% odds.
Cells F4 through F6843 are the trifecta combination.
Cell G4 is left blank for code resulting trifecta prob.

I am receiving this error while running (Object variable or With block variable not set) What am I doing wrong? What do I need to do to correct myself.


Please forgive my lack of <acronym title="visual basic for applications">VBA</acronym> understanding, But what I did was cut and paste onto sheet1 from developer tab Visual basic Icon top right.
 
Upvote 0
Ok one important thing. You have total of 5 horses (i.e. from cell B4 to B8) then how have you made 6839 trifecta combinations? I mean I think I am missing something here. Can you please post some example data say all the same ranges as above but for column-F maybe more number of rows or data? Let me re-evaluate all the stuff and will immediately come back with solution.
 
Upvote 0
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=

<tbody>
[TD="class: xl71"]horse number[/TD]
[TD="class: xl71"]100% Win prob[/TD]
[TD="class: xl71"]$2 fair win payoff[/TD]
[TD="class: xl71, width: 64"]100% odds[/TD]
[TD="class: xl68, width: 64"]Trifecta Combo[/TD]
[TD="class: xl71, width: 53"]Trifecta Win %[/TD]
[TD="class: xl72, width: 14"][/TD]
[TD="class: xl71, width: 269"]Formula[/TD]

[TD="align: right"]1[/TD]
[TD="class: xl65, align: right"]33.00%[/TD]
[TD="class: xl66, align: right"]$6.06[/TD]
[TD="class: xl66, align: right"]$2.03[/TD]
[TD="class: xl67"]1-2-3[/TD]
[TD="class: xl69, align: right"]6.74%[/TD]
[TD="class: xl70"]=[/TD]
[TD="class: xl69"]$C$4*($C$5/(1-$C$4))*(C6/(1-($C$4+$C$5)))[/TD]

[TD="align: right"]2[/TD]
[TD="class: xl65, align: right"]22.00%[/TD]
[TD="class: xl66, align: right"]$9.09[/TD]
[TD="class: xl66, align: right"]$3.55[/TD]
[TD="class: xl67"]1-2-4[/TD]
[TD="class: xl69, align: right"]4.09%[/TD]

[TD="class: xl69"]$C$4*($C$5/(1-$C$4))*(C7/(1-($C$4+$C$5)))[/TD]

[TD="align: right"]3[/TD]
[TD="class: xl65, align: right"]28.00%[/TD]
[TD="class: xl66, align: right"]$7.14[/TD]
[TD="class: xl66, align: right"]$2.57[/TD]
[TD="class: xl67"]1-3-2[/TD]
[TD="class: xl69, align: right"]7.78%[/TD]

[TD="class: xl69"]$C$4*($C$6/(1-$C$4))*(C5/(1-($C$4+$C$6)))[/TD]

[TD="align: right"]4[/TD]
[TD="class: xl65, align: right"]17.00%[/TD]
[TD="class: xl66, align: right"]$11.76[/TD]
[TD="class: xl66, align: right"]$4.88[/TD]
[TD="class: xl67"]1-3-4[/TD]
[TD="class: xl69, align: right"]6.01%[/TD]

[TD="class: xl69"]$C$4*($C$6/(1-$C$4))*(C7/(1-($C$4+$C$6)))[/TD]

[TD="class: xl67"]1-4-2[/TD]
[TD="class: xl69, align: right"]3.68%[/TD]

[TD="class: xl69"]$C$4*($C$7/(1-$C$4))*(C5/(1-($C$4+$C$7)))[/TD]

[TD="class: xl67"]1-4-3[/TD]
[TD="class: xl69, align: right"]4.69%[/TD]

[TD="class: xl69"]$C$4*($C$7/(1-$C$4))*(C6/(1-($C$4+$C$7)))[/TD]

[TD="class: xl67"]2-1-3[/TD]
[TD="class: xl69, align: right"]5.79%[/TD]

[TD="class: xl69"]$C$5*($C$4/(1-$C$5))*(C6/(1-($C$5+$C$4)))[/TD]

[TD="class: xl67"]2-1-4[/TD]
[TD="class: xl69, align: right"]3.52%[/TD]

[TD="class: xl69"]$C$5*($C$4/(1-$C$5))*(C7/(1-($C$5+$C$4)))[/TD]

[TD="class: xl67"]2-3-1[/TD]
[TD="class: xl69, align: right"]5.21%[/TD]

[TD="class: xl69"]$C$5*($C$6/(1-$C$5))*(C4/(1-($C$5+$C$6)))[/TD]

[TD="class: xl67"]2-3-4[/TD]
[TD="class: xl69, align: right"]3.47%[/TD]

[TD="class: xl69"]$C$5*($C$6/(1-$C$5))*(C5/(1-($C$5+$C$6)))[/TD]

[TD="class: xl67"]2-4-1[/TD]
[TD="class: xl69, align: right"]2.59%[/TD]

[TD="class: xl69"]$C$5*($C$7/(1-$C$5))*(C4/(1-($C$5+$C$7)))[/TD]

[TD="class: xl67"]2-4-3[/TD]
[TD="class: xl69, align: right"]2.20%[/TD]

[TD="class: xl69"]$C$5*($C$7/(1-$C$5))*(C6/(1-($C$5+$C$7)))[/TD]

[TD="class: xl67"]3-1-2[/TD]
[TD="class: xl69, align: right"]7.24%[/TD]

[TD="class: xl69"]$C$6*($C$4/(1-$C$6))*(C5/(1-($C$6+$C$4)))[/TD]

[TD="class: xl67"]3-1-4[/TD]
[TD="class: xl69, align: right"]5.59%[/TD]

[TD="class: xl69"]$C$6*($C$4/(1-$C$6))*(C7/(1-($C$6+$C$4)))[/TD]

[TD="class: xl67"]3-2-1[/TD]
[TD="class: xl69, align: right"]5.65%[/TD]

[TD="class: xl69"]$C$6*($C$5/(1-$C$6))*(C4/(1-($C$6+$C$5)))[/TD]

[TD="class: xl67"]3-2-4[/TD]
[TD="class: xl69, align: right"]2.91%[/TD]

[TD="class: xl69"]$C$6*($C$5/(1-$C$6))*(C7/(1-($C$6+$C$5)))[/TD]

[TD="class: xl67"]3-4-1[/TD]
[TD="class: xl69, align: right"]3.97%[/TD]

[TD="class: xl69"]$C$6*($C$7/(1-$C$6))*(C4/(1-($C$6+$C$7)))[/TD]

[TD="class: xl67"]3-4-2[/TD]
[TD="class: xl69, align: right"]2.64%[/TD]

[TD="class: xl69"]$C$6*($C$7/(1-$C$6))*(C5/(1-($C$6+$C$7)))[/TD]

[TD="class: xl67"]4-1-2[/TD]
[TD="class: xl69, align: right"]2.97%[/TD]

[TD="class: xl69"]$C$7*($C$4/(1-$C$7))*(C5/(1-($C$7+$C$4)))[/TD]

[TD="class: xl67"]4-1-3[/TD]
[TD="class: xl69, align: right"]3.79%[/TD]

[TD="class: xl69"]$C$7*($C$4/(1-$C$7))*(C6/(1-($C$7+$C$4)))[/TD]

[TD="class: xl67"]4-2-1[/TD]
[TD="class: xl69, align: right"]2.44%[/TD]

[TD="class: xl69"]$C$7*($C$5/(1-$C$7))*(C4/(1-($C$7+$C$5)))[/TD]

[TD="class: xl67"]4-2-3[/TD]
[TD="class: xl69, align: right"]1.63%[/TD]

[TD="class: xl69"]$C$7*($C$5/(1-$C$7))*(C5/(1-($C$7+$C$5)))[/TD]

[TD="class: xl67"]4-3-1[/TD]
[TD="class: xl69, align: right"]3.44%[/TD]

[TD="class: xl69"]$C$7*($C$6/(1-$C$7))*(C4/(1-($C$7+$C$6)))[/TD]

[TD="class: xl67"]4-3-2[/TD]
[TD="class: xl69, align: right"]2.29%[/TD]

[TD="class: xl69"]$C$7*($C$6/(1-$C$7))*(C5/(1-($C$7+$C$6)))[/TD]

</tbody>
 
Upvote 0
I just copied all possible combinations from my other worksheet. that's why there were 6840 combinations listed, sorry for the confusion. I posted a new look at this above.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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