Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default Time Between 2 intervals

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 ?
  #2   Report Post  
Posted to microsoft.public.excel.programming
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 ?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Time Between 2 intervals

look at Chip Pearson's site for the application.OnTime method
http://www.cpearson.com/excel/ontime.htm

Dates/times are stored as the elapesed number of days from a base date. To
get the elapsed number of hours

(End-Start)*24


--
Regards,
Tom Ogilvy

"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 ?



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
Calculating date/time intervals?? jj Excel Worksheet Functions 1 May 29th 10 12:24 AM
Time Clock Intervals Laura Excel Discussion (Misc queries) 2 October 18th 07 09:22 PM
SUM-ing date for different time intervals Mortir Excel Worksheet Functions 3 December 11th 06 06:26 PM
comparing time intervals znaya Excel Worksheet Functions 0 May 8th 06 06:47 PM
Time Intervals ChrisM Excel Worksheet Functions 1 December 7th 05 09:50 PM


All times are GMT +1. The time now is 10:34 PM.

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"