+ Reply to Thread
Results 1 to 3 of 3

Finding Time difference

  1. #1
    John Harris
    Guest

    Finding Time difference

    I know this has to be easy. I have a start time and an end time. I need the
    difference in hours and minutes. I used the examples in the help, but it
    converts it to text and then it won't add. Anyone?

    TIA

    JC




  2. #2
    JE McGimpsey
    Guest

    Re: Finding Time difference

    One way:

    A1: <start time>
    B1: <end time>

    C1: =B1-A1

    format C1 as time.

    XL stores times as fractional days (e.g., 3:00 = 0.125), so if your
    times span midnight, the "later" time will be smaller than the "earlier"
    time. Compensate that by adding 1 to the "end time". You can take
    advantage of XL's automatic coercion of boolean TRUE/FALSE values to 1/0:

    =(B1<A1) + B1 - A1

    or the more obscure, but equivalent:

    =MOD(B1-A1, 1)

    In article <#[email protected]>,
    "John Harris" <[email protected]> wrote:

    > I know this has to be easy. I have a start time and an end time. I need the
    > difference in hours and minutes. I used the examples in the help, but it
    > converts it to text and then it won't add. Anyone?


  3. #3
    Dave Peterson
    Guest

    Re: Finding Time difference

    One more version that might be even more clear:

    =B1-A1+IF(B1<A1,1,0)

    Still following JE's rules:
    A1: <start time>
    B1: <end time>



    John Harris wrote:
    >
    > I know this has to be easy. I have a start time and an end time. I need the
    > difference in hours and minutes. I used the examples in the help, but it
    > converts it to text and then it won't add. Anyone?
    >
    > TIA
    >
    > JC


    --

    Dave Peterson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1