Dec 21 2018 03:24 PM
Is there a way to count the number of occurrences of particular randomly generated values as they are generated?
Specifically:
Numbers from 1 to 10 are randomly generated in a particular cell.
Is there a formula to calculate the number of 1's and 2's etc that are generated cumulatively?
Dec 21 2018 11:25 PM
Hi,
You definitely need to a VBA code to do so!
So I would suggest this one below and you will find it in the attached file.
Sub CountTheNumberOfRandomlyGeneratedValueCumulatively()
Dim cell As Range
For Each cell In Range("C1:C10")
If cell.Value = Range("A1").Value Then
cell.Offset(0, 1).Value = cell.Offset(0, 1).Value + 1
Exit For
End If
Next
End Sub
Hope that helps