Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 31
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 33
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accumulated Time Format Ray[_3_] Excel Discussion (Misc queries) 2 August 4th 07 12:07 PM
Accumulated wealth formula ? toyota58 Excel Worksheet Functions 8 February 24th 07 01:54 AM
How to add a column of accumulated data in pivottable? Angus Excel Worksheet Functions 1 November 23rd 05 07:47 PM
How to calculate the accumulated payments from an annuity at yr 10 jmuirman Excel Worksheet Functions 1 August 8th 05 08:05 PM
How do I calculate the accumulated payments from an annuity at yr jmuirman New Users to Excel 2 August 7th 05 04:29 PM


All times are GMT +1. The time now is 05:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"