by waynethebrayn » Fri Feb 23, 2007 6:35 pm
Hi all,
Came across this recently while trying to find a way to trigger events after a market has gone in play. I copied the stuff below from the web:
"Using circular references and worksheet functions
You can use a circular reference to enter the time when a change is made in another cell, then maintain that time. Choose Tools/Options/Calculation (Preferences/Calculation for Macs) and check the Iteration checkbox. Then, if your target cell is A1 and you want the date/time to appear in B1, enter this in B1:
=IF(A1="","",IF(B1="",NOW(),B1))
Format B1 as you wish to display date, time, or both. If A1 is initially blank, B1 will return a null string (""). When a value is entered into A1, B1 will evaluate as "", therefore NOW() will be returned. After that (as long as A1 remains populated), B1 will evaluate to a date/time and therefore will return the value in B1 - i.e., the date/time."
The way I use it is as follows:
In cell Q2 I have: =IF(E2="In Play","In Play","")
In R2: =IF(Q2="","",IF(R2="",NOW(),R2))
In S2: =IF(E2="In Play",NOW()-R2,0)
With this, when the market turns in play the cell S2 starts counting upwards. I use another cell to provide a 15 second delay before triggering bets, to allow the in play market to settle down.
Hope this helps anybody, and apologies if you know all this already (I didn't until this week!)