Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
how to create an accumulated value
I have a random number generator between 81-88 which produces a new value
each time excel calculates. I would like to count each time the value of the previous number generated and the new number passes by a current value. Say 81.5. Here's my questions... 1. Since i have to compare the previous number to the new number how do I capture the previous number so it does not change and i can then compare it to the new random number created? 2. How do i create an accumulator that counts the number of times the value passes a given number say 81.5 when comparing the previous number to the newly generated number. Again the random generator creates a number between 81-88 each time. Thx Dave |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
how to create an accumulated value
I think you'll need a macro. Assuming your random number is in cell B1 and
the accumulator is in cell B2: Sub Macro1() accum = Range("B2").Value oldvalue = Range("B1").Value Application.Calculate newvalue = Range("B1").Value If newvalue oldvalue Then Range("B2").Value = accum + 1 End Sub "DaveM" wrote: I have a random number generator between 81-88 which produces a new value each time excel calculates. I would like to count each time the value of the previous number generated and the new number passes by a current value. Say 81.5. Here's my questions... 1. Since i have to compare the previous number to the new number how do I capture the previous number so it does not change and i can then compare it to the new random number created? 2. How do i create an accumulator that counts the number of times the value passes a given number say 81.5 when comparing the previous number to the newly generated number. Again the random generator creates a number between 81-88 each time. Thx Dave |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Accumulated Time Format | Excel Discussion (Misc queries) | |||
Accumulated wealth formula ? | Excel Worksheet Functions | |||
How to add a column of accumulated data in pivottable? | Excel Worksheet Functions | |||
How to calculate the accumulated payments from an annuity at yr 10 | Excel Worksheet Functions | |||
How do I calculate the accumulated payments from an annuity at yr | New Users to Excel |