B column's values are manually typed
C column's values is a result of =RAND() FORMULA
Thank you
Alright, so I think I'm on the right track for what you want here. I put this together and tested it to be sure it works. With RAND in place, the macro turns off calculations mid-run to grab the current totals before purposely triggering the reset.
Code:
Sub Collect()
'This macro will run 1000 scripts and provide statistics as requested
'Cell L2 has been set as the Run Total for counting measures
'H2 captures Marks total score
'H3 captures Tonys total score
Dim Runcount As Integer
Dim Mark As Integer
Dim Tony As Integer
Dim Score As String
Dim ScoreSet As String
Dim ScorePlus As Integer
Dim Dash As String
Application.ScreenUpdating = False
Dash = (Chr(45))
Range("L2").Value = 0
Range("H5:H25").Select
Selection.ClearContents
Runcount = Range("L2")
Do Until Runcount = 1000
Range("C13").Select
ActiveCell.FormulaR1C1 = ""
Range("C14").Select
Application.Calculation = xlCalculationManual
Mark = Range("H2")
Tony = Range("H3")
Score = Mark & Dash & Tony
For Each Line In Range(Cells(5, "G"), Cells(5, "G").End(xlDown))
ScoreSet = Cells(Line.Row, 7)
If Score = ScoreSet Then
ScorePlus = Cells(Line.Row, 8)
ScorePlus = ScorePlus + 1
Cells(Line.Row, 8).Value = ScorePlus
Else
End If
Next
Application.Calculation = xlCalculationAutomatic
Runcount = Runcount + 1
Range("L2").Value = Runcount
Loop
Application.ScreenUpdating = True
End Sub
This is how I have the layout of the sheet for this macro to run right....
[TABLE="class: grid, width: 347, align: center"]
<TBODY>[TR]
[TD]Player Name
(A1)</SPAN>[/TD]
[TD]Score</SPAN>[/TD]
[TD]RAND</SPAN>[/TD]
[TD]Point</SPAN>[/TD]
[/TR]
[TR]
[TD]Mark</SPAN>[/TD]
[TD]
0.5</SPAN>[/TD]
[TD]0.508658441</SPAN>[/TD]
[TD]0</SPAN>[/TD]
[/TR]
[TR]
[TD]Tony</SPAN>[/TD]
[TD]
0.254</SPAN>[/TD]
[TD]0.968425994</SPAN>[/TD]
[TD]0</SPAN>[/TD]
[/TR]
[TR]
[TD]Mark</SPAN>[/TD]
[TD]
0.369</SPAN>[/TD]
[TD]0.413288778</SPAN>[/TD]
[TD]0</SPAN>[/TD]
[/TR]
[TR]
[TD]Mark</SPAN>[/TD]
[TD]
0.471</SPAN>[/TD]
[TD]0.806637426</SPAN>[/TD]
[TD]0</SPAN>[/TD]
[/TR]
[TR]
[TD]Tony</SPAN>[/TD]
[TD]
0.21</SPAN>[/TD]
[TD]0.814040217</SPAN>[/TD]
[TD]0</SPAN>[/TD]
[/TR]
[TR]
[TD]Mark</SPAN>[/TD]
[TD]
0.15</SPAN>[/TD]
[TD]0.068789169</SPAN>[/TD]
[TD]1</SPAN>[/TD]
[/TR]
[TR]
[TD]Tony</SPAN>[/TD]
[TD]
0.369</SPAN>[/TD]
[TD]0.986007417</SPAN>[/TD]
[TD]0</SPAN>[/TD]
[/TR]
[TR]
[TD]Tony</SPAN>[/TD]
[TD]
0.471</SPAN>[/TD]
[TD]0.827633459</SPAN>[/TD]
[TD]0
(D10)[/TD]
[/TR]
</TBODY>[/TABLE]
Cells in blue are those you identified would be manually updated. Points of placement A1 & D10 in red for accuracy.
Offset to the right I have placed an anchor for Mark & Tony totals, using the folloing format and formula offset in green.
[TABLE="class: grid, width: 500"]
<TBODY>[TR]
[TD]Name
(G)[/TD]
[TD]Total
(H)[/TD]
[TD]Formula in H cells[/TD]
[/TR]
[TR]
[TD]Mark
(G2)[/TD]
[TD]1
(H2)[/TD]
[TD]
=SUMIF($A$2:$A$9,"Mark",$D$2:$D$9)[/TD]
[/TR]
[TR]
[TD]Tony
(G3)[/TD]
[TD]0
(H3)[/TD]
[TD]
=SUMIF($A$2:$A$9,"Tony",$D$2:$D$9)[/TD]
[/TR]
</TBODY>[/TABLE]
Further offset, I have a counter for the number of runs completed.
[TABLE="class: grid, width: 500"]
<TBODY>[TR]
[TD]Title
(K)[/TD]
[TD]Count of Runs
(L)[/TD]
[/TR]
[TR]
[TD]Total Runs
(K2)[/TD]
[TD]X
(L2)[/TD]
[/TR]
</TBODY>[/TABLE]
Beneath all this, I have your table for potential outcomes, I expanded the list to the full list of potential outcomes.
[TABLE="class: grid, width: 671, align: right"]
<TBODY>[TR]
[TD]Potential Outcome</SPAN>[/TD]
[TD]Point for Succes in outcome</SPAN>[/TD]
[TD]Outcome %</SPAN>[/TD]
[TD]Formula for % Column</SPAN>[/TD]
[/TR]
[TR]
[TD]0-0
(G5)</SPAN>[/TD]
[TD]35</SPAN>[/TD]
[TD]4.28%</SPAN>[/TD]
[TD]
=IF(H5=0,"",H5/SUM($H$5:$H$25))</SPAN>[/TD]
[/TR]
[TR]
[TD]0-1</SPAN>[/TD]
[TD]54</SPAN>[/TD]
[TD]6.60%</SPAN>[/TD]
[TD]
=IF(H6=0,"",H6/SUM($H$5:$H$25))</SPAN>[/TD]
[/TR]
[TR]
[TD]0-2</SPAN>[/TD]
[TD]45</SPAN>[/TD]
[TD]5.50%</SPAN>[/TD]
[TD]
=IF(H7=0,"",H7/SUM($H$5:$H$25))</SPAN>[/TD]
[/TR]
[TR]
[TD]0-3</SPAN>[/TD]
[TD]14</SPAN>[/TD]
[TD]1.71%</SPAN>[/TD]
[TD]
=IF(H8=0,"",H8/SUM($H$5:$H$25))</SPAN>[/TD]
[/TR]
[TR]
[TD]0-4</SPAN>[/TD]
[TD]1</SPAN>[/TD]
[TD]0.12%</SPAN>[/TD]
[TD]
=IF(H9=0,"",H9/SUM($H$5:$H$25))</SPAN>[/TD]
[/TR]
[TR]
[TD]1-0</SPAN>[/TD]
[TD][/TD]
[TD][/TD]
[TD]
=IF(H10=0,"",H10/SUM($H$5:$H$25))</SPAN>[/TD]
[/TR]
[TR]
[TD]1-1</SPAN>[/TD]
[TD]176</SPAN>[/TD]
[TD]21.52%</SPAN>[/TD]
[TD]
=IF(H11=0,"",H11/SUM($H$5:$H$25))</SPAN>[/TD]
[/TR]
[TR]
[TD]1-2</SPAN>[/TD]
[TD]120</SPAN>[/TD]
[TD]14.67%</SPAN>[/TD]
[TD]
=IF(H12=0,"",H12/SUM($H$5:$H$25))</SPAN>[/TD]
[/TR]
[TR]
[TD]1-3</SPAN>[/TD]
[TD]30</SPAN>[/TD]
[TD]3.67%</SPAN>[/TD]
[TD]
=IF(H13=0,"",H13/SUM($H$5:$H$25))</SPAN>[/TD]
[/TR]
[TR]
[TD]1-4</SPAN>[/TD]
[TD]4</SPAN>[/TD]
[TD]0.49%</SPAN>[/TD]
[TD]
=IF(H14=0,"",H14/SUM($H$5:$H$25))</SPAN>[/TD]
[/TR]
[TR]
[TD]2-0</SPAN>[/TD]
[TD][/TD]
[TD][/TD]
[TD]
=IF(H15=0,"",H15/SUM($H$5:$H$25))</SPAN>[/TD]
[/TR]
[TR]
[TD]2-1</SPAN>[/TD]
[TD]112</SPAN>[/TD]
[TD]13.69%</SPAN>[/TD]
[TD]
=IF(H16=0,"",H16/SUM($H$5:$H$25))</SPAN>[/TD]
[/TR]
[TR]
[TD]2-2</SPAN>[/TD]
[TD]97</SPAN>[/TD]
[TD]11.86%</SPAN>[/TD]
[TD]
=IF(H17=0,"",H17/SUM($H$5:$H$25))</SPAN>[/TD]
[/TR]
[TR]
[TD]2-3</SPAN>[/TD]
[TD]33</SPAN>[/TD]
[TD]4.03%</SPAN>[/TD]
[TD]
=IF(H18=0,"",H18/SUM($H$5:$H$25))</SPAN>[/TD]
[/TR]
[TR]
[TD]2-4</SPAN>[/TD]
[TD]2</SPAN>[/TD]
[TD]0.24%</SPAN>[/TD]
[TD]
=IF(H19=0,"",H19/SUM($H$5:$H$25))</SPAN>[/TD]
[/TR]
[TR]
[TD]3-0</SPAN>[/TD]
[TD][/TD]
[TD][/TD]
[TD]
=IF(H20=0,"",H20/SUM($H$5:$H$25))</SPAN>[/TD]
[/TR]
[TR]
[TD]3-1</SPAN>[/TD]
[TD]53</SPAN>[/TD]
[TD]6.48%</SPAN>[/TD]
[TD]
=IF(H21=0,"",H21/SUM($H$5:$H$25))</SPAN>[/TD]
[/TR]
[TR]
[TD]3-2</SPAN>[/TD]
[TD]29</SPAN>[/TD]
[TD]3.55%</SPAN>[/TD]
[TD]
=IF(H22=0,"",H22/SUM($H$5:$H$25))</SPAN>[/TD]
[/TR]
[TR]
[TD]3-3</SPAN>[/TD]
[TD]13</SPAN>[/TD]
[TD]1.59%</SPAN>[/TD]
[TD]
=IF(H23=0,"",H23/SUM($H$5:$H$25))</SPAN>[/TD]
[/TR]
[TR]
[TD]3-4</SPAN>[/TD]
[TD][/TD]
[TD][/TD]
[TD]
=IF(H24=0,"",H24/SUM($H$5:$H$25))</SPAN>[/TD]
[/TR]
[TR]
[TD]4-0</SPAN>[/TD]
[TD][/TD]
[TD][/TD]
[TD]
=IF(H25=0,"",H25/SUM($H$5:$H$25))</SPAN>[/TD]
[/TR]
[TR]
[TD]4-1</SPAN>[/TD]
[TD]3</SPAN>[/TD]
[TD]0.37%</SPAN>[/TD]
[TD]
=IF(H26=0,"",H26/SUM($H$5:$H$25))</SPAN>[/TD]
[/TR]
[TR]
[TD]4-2</SPAN>[/TD]
[TD]6</SPAN>[/TD]
[TD]0.73%</SPAN>[/TD]
[TD]
=IF(H27=0,"",H27/SUM($H$5:$H$25))</SPAN>[/TD]
[/TR]
[TR]
[TD]4-3</SPAN>[/TD]
[TD]2</SPAN>[/TD]
[TD]0.24%</SPAN>[/TD]
[TD]
=IF(H28=0,"",H28/SUM($H$5:$H$25))</SPAN>[/TD]
[/TR]
[TR]
[TD]4-4</SPAN>[/TD]
[TD][/TD]
[TD]
(I29)[/TD]
[TD]
=IF(H29=0,"",H29/SUM($H$5:$H$25))</SPAN>[/TD]
[/TR]
</TBODY><COLGROUP><COL><COL><COL><COL></COLGROUP>[/TABLE]