Thread: Stopwatch
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
smartin smartin is offline
external usenet poster
 
Posts: 915
Default Stopwatch

pomegranate-man wrote:
Can Excel be programed to perform a stopwatch function?


I did the following with Excel 2003 and it seems to work.


One-time-setup of the spreadsheet
---------------------------------

Start with
File New Blank workbook

To allow circular references, use
Tools Options Calculation
Check the "Iterations" checkbox.
Set "Maximum iterations" to 1 (one).

Type the letter x into cell A2.

In cell A1, put
=IF(A2="",A1+1,-1)

In cell B1, put
=IF($A$2="",IF(ROW()=$A$1,NOW(),B1),0)
Extend this down for at least as many rows as there are steps for the
time readings.

Select column B and use
Format Cells Number Custom
with the pattern
hh:mm:ss.00;;

In columns C onward, put calculations using time readings that will
appear in column B later. For example, putting
=B2-B1
in C2 and extending down would calculate difference times between steps.

Save the workbook. It'll serve as a starting point each time.


To use the stopwatch
--------------------

Open the saved workbook.

To activate the stopwatch, delete the contents of A2.

To click the stopwatch, press the F9 key . A new time reading appears in
column B each time F9 is pressed.

Once you are finished, you can (optionally) reset the spreadsheet by
typing x in A2 again. This way, the spreadsheet can be re-used without
opening it again.


Caution
-------

Allowing circular references can be a risk. Later, if you make a
circular reference in the workbook by mistake, Excel won't flag it as an
error.



I had to try it. Brilliant!