+ Reply to Thread
Results 1 to 7 of 7

Calculate difference (mins) between 2 Times

  1. #1
    Max
    Guest

    Calculate difference (mins) between 2 Times

    Hi guys,

    Re-table below in cols A to C where its required
    to calculate the "Diff (mins)" in col C
    (Col C = Time B - Time A)

    Times are in text in cols A & B in the form: 0245 hrs, 0315 hrs, etc

    Time A Time B Diff (mins)
    0245 hrs 0315 hrs 30
    0705 hrs 0735 hrs 30
    1955 hrs 2050 hrs 55
    2335 hrs 0005 hrs 30
    2355 hrs 0035 hrs 40
    etc

    What can I put in C2, and copy down to return the desired results ?
    Thanks
    --
    Rgds
    Max
    xl 97
    ---
    Singapore, GMT+8
    xdemechanik
    http://savefile.com/projects/236895
    --



  2. #2
    Arvi Laanemets
    Guest

    Re: Calculate difference (mins) between 2 Times

    Hi

    =TIME(LEFT(B2,2),MID(B2,3,2),0)-TIME(LEFT(A2,2),MID(A2,3,2),0)+(TIME(LEFT(B2,2),MID(B2,3,2),0)<TIME(LEFT(A2,2),MID(A2,3,2),0))


    --
    Arvi Laanemets
    ( My real mail address: arvil<at>tarkon.ee )



    "Max" <demechanik@yahoo.com> wrote in message
    news:uGon6VizFHA.1252@TK2MSFTNGP09.phx.gbl...
    > Hi guys,
    >
    > Re-table below in cols A to C where its required
    > to calculate the "Diff (mins)" in col C
    > (Col C = Time B - Time A)
    >
    > Times are in text in cols A & B in the form: 0245 hrs, 0315 hrs, etc
    >
    > Time A Time B Diff (mins)
    > 0245 hrs 0315 hrs 30
    > 0705 hrs 0735 hrs 30
    > 1955 hrs 2050 hrs 55
    > 2335 hrs 0005 hrs 30
    > 2355 hrs 0035 hrs 40
    > etc
    >
    > What can I put in C2, and copy down to return the desired results ?
    > Thanks
    > --
    > Rgds
    > Max
    > xl 97
    > ---
    > Singapore, GMT+8
    > xdemechanik
    > http://savefile.com/projects/236895
    > --
    >
    >




  3. #3
    Max
    Guest

    Re: Calculate difference (mins) between 2 Times

    Thanks, Arvi !
    (I multiplied the results returned
    by 24*60 to convert it to numbers)
    --
    Rgds
    Max
    xl 97
    ---
    Singapore, GMT+8
    xdemechanik
    http://savefile.com/projects/236895
    --
    "Arvi Laanemets" <garbage@hot.ee> wrote in message
    news:uoY1QeizFHA.464@TK2MSFTNGP15.phx.gbl...
    > Hi
    >
    >

    =TIME(LEFT(B2,2),MID(B2,3,2),0)-TIME(LEFT(A2,2),MID(A2,3,2),0)+(TIME(LEFT(B2
    ,2),MID(B2,3,2),0)<TIME(LEFT(A2,2),MID(A2,3,2),0))
    >
    >
    > --
    > Arvi Laanemets
    > ( My real mail address: arvil<at>tarkon.ee )




  4. #4
    Peo Sjoblom
    Guest

    Re: Calculate difference (mins) between 2 Times

    Max wrote:
    > Hi guys,
    >
    > Re-table below in cols A to C where its required
    > to calculate the "Diff (mins)" in col C
    > (Col C = Time B - Time A)
    >
    > Times are in text in cols A & B in the form: 0245 hrs, 0315 hrs, etc
    >
    > Time A Time B Diff (mins)
    > 0245 hrs 0315 hrs 30
    > 0705 hrs 0735 hrs 30
    > 1955 hrs 2050 hrs 55
    > 2335 hrs 0005 hrs 30
    > 2355 hrs 0035 hrs 40
    > etc
    >
    > What can I put in C2, and copy down to return the desired results ?
    > Thanks
    > --
    > Rgds
    > Max
    > xl 97
    > ---
    > Singapore, GMT+8
    > xdemechanik
    > http://savefile.com/projects/236895
    > --
    >
    >

    Another way

    =(MOD((INT(LEFT(B2,4)/100)+MOD(LEFT(B2,4),100)/60)/24-(INT(LEFT(A2,4)/100)+MOD(LEFT(A2,4),100)/60)/24,1)*1440)

    Regards,

    Peo Sjoblom

  5. #5
    Max
    Guest

    Re: Calculate difference (mins) between 2 Times

    Works great, Peo !
    Thanks ..
    --
    Rgds
    Max
    xl 97
    ---
    Singapore, GMT+8
    xdemechanik
    http://savefile.com/projects/236895
    --
    "Peo Sjoblom" <terre08@mvps.org> wrote in message
    news:uiZtVtizFHA.2960@tk2msftngp13.phx.gbl...
    > Another way
    >
    >

    =(MOD((INT(LEFT(B2,4)/100)+MOD(LEFT(B2,4),100)/60)/24-(INT(LEFT(A2,4)/100)+M
    OD(LEFT(A2,4),100)/60)/24,1)*1440)
    >
    > Regards,
    >
    > Peo Sjoblom




  6. #6
    Arvi Laanemets
    Guest

    Re: Calculate difference (mins) between 2 Times

    Hi

    The another option was to format the cell with my formula as "[m]" or
    "[m]:ss"


    --
    Arvi Laanemets
    ( My real mail address: arvil<at>tarkon.ee )


    "Max" <demechanik@yahoo.com> wrote in message
    news:u3jMQqizFHA.2884@TK2MSFTNGP09.phx.gbl...
    > Thanks, Arvi !
    > (I multiplied the results returned
    > by 24*60 to convert it to numbers)
    > --
    > Rgds
    > Max
    > xl 97
    > ---
    > Singapore, GMT+8
    > xdemechanik
    > http://savefile.com/projects/236895
    > --
    > "Arvi Laanemets" <garbage@hot.ee> wrote in message
    > news:uoY1QeizFHA.464@TK2MSFTNGP15.phx.gbl...
    >> Hi
    >>
    >>

    > =TIME(LEFT(B2,2),MID(B2,3,2),0)-TIME(LEFT(A2,2),MID(A2,3,2),0)+(TIME(LEFT(B2
    > ,2),MID(B2,3,2),0)<TIME(LEFT(A2,2),MID(A2,3,2),0))
    >>
    >>
    >> --
    >> Arvi Laanemets
    >> ( My real mail address: arvil<at>tarkon.ee )

    >
    >




  7. #7
    Max
    Guest

    Re: Calculate difference (mins) between 2 Times

    Noted with thanks, Arvi !
    I went for the "simple" numbers conversion
    as there would be downstream calcs in due course
    --
    Rgds
    Max
    xl 97
    ---
    Singapore, GMT+8
    xdemechanik
    http://savefile.com/projects/236895
    --
    "Arvi Laanemets" <garbage@hot.ee> wrote in message
    news:e7mqq4izFHA.612@TK2MSFTNGP10.phx.gbl...
    > Hi
    >
    > The another option was to format the cell with my formula as "[m]" or
    > "[m]:ss"
    >
    >
    > --
    > Arvi Laanemets
    > ( My real mail address: arvil<at>tarkon.ee )




+ 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