counting the number of ticks

  • Thread starter Thread starter gi
  • Start date Start date
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.
 
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
 
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.
 
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.
 
Frank,
THANK YOU very much. That did the trick. I greatly appreciate it.

-gi lee
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top