counting the number of ticks

G

gi

Hi to all excel Gurus:
I was hoping some could help me. I've created a financial model using
spinners to change values in a single cell and it produces an output
in another cell stating if I go bankrupt (simple "yes" or blank).
Now, I have set up my model so that I can use the spinner to go
through a 1000 trials. Right now, I've been physically counting the
number of "yes" that comes up. Is there a way I can have excel
automatically track the number of times "yes" comes up as I spin
through a 1000 trials. Thank you.
 
A

Anders S

Hi,

Not sure I understand, but if you are using a SpinButton you can use the
button's Change event to read and record the results. Here's a small example:

'-----
Option Explicit
Dim yCount As Integer
Private Sub SpinButton1_Change()
If Range("A1").Value = "Yes" Then
yCount = yCount + 1
Range("B1").Value = yCount
End If
End Sub
'-----

HTH
Anders Silven
 
G

gi lee

Anders, Thank you for the reply. I'm sorry for not being clear. I am
using the spinners to run a 1000 trials in my model. So the Spinner is
set to toggle 1 through 1000, which are the trial. For each trial it
outputs a result into single cell indicating "yes" or a blank. Right
now I manually count the number of times a "yes" comes out. Is there a
way for me to use excel to tell me how many times "yes" comes up as I
click through each trial. I really appreciate your help.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
G

gi lee

Frank, Thanks for the tip but countif doesn't work because i am
outputing the "yes" result into the same cell. Therefore the cell will
either say "yes" or will be blank for each of the runs and Countif
doesn't record/remember each trial.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Top