Increment Count on Recalc

P

PaulT99

How do I cause a count to increment when the spreadsheet recalculate
(F9)? Every time I recalc the count gets reset back to 0. I have trie
several of the count functions and none seem to do what I want.

I have multiple count fields and want one of my "Count" field to
increment each time the F9 key is pressed based on certain criteria.

Thanks,

Paul
 
F

Frank Kabel

Hi
you may use the worksheet_calculate event to incremebt a cell on your
file. though I'm not so sure what you're trying to achieve with this
procedure :)
 
P

PaulT99

I am playing with probability.
I have 2 columns of random integers.
I'm counting how many times a number in column 1 matches a number i
column 2.
If there's 1 match the first time, the "Count = 1" cell would go from
to 1. If on the next recalculation there is also 1 match, then th
"Count = 1" cell should increment to 2.

Any help is appreciated.

Paul
 
P

PaulT99

I figured it out.

A two cell accumulator can be constructed without VBA using circula
references. To avoid an error, first choose Tools/Options/Calculatio
and check the Iterations checkbox. Enter 1 in the number of iteration
box. Now enter the following

B1: =SUM (A1 + B1)

Pretty simple
 
G

Gord Dibben

Paul

And if you make a mistake in your data entry.....??

Also, each time Excel re-calculates, the total will change.

Risky method.

Gord Dibben Excel MVP
 

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

Top