View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
shockley shockley is offline
external usenet poster
 
Posts: 135
Default Time Between 2 intervals

If you have two time points, say that are on different days and you want to
calculate the amount of time between them, you can do something like this:

Assign each time point to a variable, as it occurs, like:

timeA = Now

When you have your two timepoints, timeA and timeB, you can then get the
amount of time between them:

timeDif = timeB - timeA

which will be a decimal value for the number of days between the two time
points.

You can then convert this to whatever time unit you like, for example:

timeDifHours = timeDif * 24
timeDifSeconds = timeDif * 86400

HTH,
Shockley

"Neil" wrote in message
...
I have a set of values that are being measure every 5
seconds, when the values are falling and hit a low point
I want to set a marker that is the time and date. some
time later maybe 1,2 or 3 days, it will drop again, and I
want to log another marker and work out the time in hours
between the two. I set of with a number of if then else
statements to decide how many days differance there were,
then tried to work out the hours but It all fell apart.
Is there any easy way of seting off a timer and then
stopping it ? I looked at the timer function but this
only gives the number of seconds since the last midnight ?