Elapsed time calc

  • Thread starter Thread starter GFH
  • Start date Start date
G

GFH

Hi All,

I been thru most of this newsgroup but can't quite put together the
answer..

I have two times and want to calculate the elapsed time between the
two.

No problem as long as I stay within the same day/24 hour period, but
ocasionally I may have a 20:30 start and a 01:30 finish with the
elapsed time formatted as [h]:mm

I normally just subtract the finish time from the start time formatted
as [h]:mm, but with the above example it of course doesn't work that
way..

Can one of you guru's sort this out for me..

what I need is....

Start Finish Elapsed

12:00 14:30 2:30
20:00 02:00 6:00



Thanks
 
Try

=MOD(B1-A1,1)

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Thanks Bob,

That worked but I don'tunderstand how the MOD function handles this.
I though MOD returned the remainder of the division of two numbers?

Oh well
 
Thanks Bob,

but I don't understand hw the MOD function handles this I thought MOD
was used to return a remainder of the division of 2 numbers
 
It does. It works because time is held as a fraction of 1 day, and when you
mod that with

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Try again.

It does. It works because time is held as a fraction of 1 day, and when you
mod that with 1 it will return that remainder. A few examples

18:00 to 22:00, B1-A1 returns 1.66666667, which when MODed with 1 , still
gives 1.6666667, which is 4 hours

22:00 to 02:00, B1-A1 returns -.75, which when MODed with 1, then gives .25,
which is 4 hours.

Voila, it all works.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Always best when you understand<g>

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top