+ Reply to Thread
Results 1 to 6 of 6

adding/subtracting time

  1. #1

    adding/subtracting time

    I have a worksheet with times formatted as [$-409]h:mm AM/PM;@. I
    don't understand the format and would like to be able to subtract times
    to get total hours.

    i.e. start time = 2:00 PM and end time= 10:00 PM Hours=8
    start time = 10:00 PM and end time= 2:00 AM Hours=4


    Since I don't understand the current time format (or why they didn't
    just use an existing MS format), I don't know how to get my calculation
    to work.

    TIA


  2. #2
    Bob Phillips
    Guest

    Re: adding/subtracting time

    It shouldn't make any difference, it is still just a time value underneath,
    so just add them

    =A1+B1

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    <[email protected]> wrote in message
    news:[email protected]...
    > I have a worksheet with times formatted as [$-409]h:mm AM/PM;@. I
    > don't understand the format and would like to be able to subtract times
    > to get total hours.
    >
    > i.e. start time = 2:00 PM and end time= 10:00 PM Hours=8
    > start time = 10:00 PM and end time= 2:00 AM Hours=4
    >
    >
    > Since I don't understand the current time format (or why they didn't
    > just use an existing MS format), I don't know how to get my calculation
    > to work.
    >
    > TIA
    >




  3. #3
    kat
    Guest

    Re: adding/subtracting time

    That works great when the time is within the same day, but when it
    starts at 10:00PM and ends at 2:00AM I can't calculate the hours.

    Currently I just threw out their format and used your solution with the
    if function: =IF(b1>a1,"24:00"-(a1-b1),b1-a1) Maybe I overdid it??
    but it seems to work fine.

    Just curious if anyone has ever come across the weird format I
    described in the first post. I thought maybe it was some MVP
    supersolution


  4. #4
    Roger Govier
    Guest

    Re: adding/subtracting time

    Hi Kat

    With start in A1 and End in B1
    =MOD(B1,A1,1)
    will deal with either scenario

    --
    Regards

    Roger Govier


    "kat" <[email protected]> wrote in message
    news:[email protected]...
    > That works great when the time is within the same day, but when it
    > starts at 10:00PM and ends at 2:00AM I can't calculate the hours.
    >
    > Currently I just threw out their format and used your solution with
    > the
    > if function: =IF(b1>a1,"24:00"-(a1-b1),b1-a1) Maybe I overdid it??
    > but it seems to work fine.
    >
    > Just curious if anyone has ever come across the weird format I
    > described in the first post. I thought maybe it was some MVP
    > supersolution
    >




  5. #5
    Bob Phillips
    Guest

    Re: adding/subtracting time

    I think Roger means

    =MOD(B1-A1,1)

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Roger Govier" <[email protected]> wrote in message
    news:[email protected]...
    > Hi Kat
    >
    > With start in A1 and End in B1
    > =MOD(B1,A1,1)
    > will deal with either scenario
    >
    > --
    > Regards
    >
    > Roger Govier
    >
    >
    > "kat" <[email protected]> wrote in message
    > news:[email protected]...
    > > That works great when the time is within the same day, but when it
    > > starts at 10:00PM and ends at 2:00AM I can't calculate the hours.
    > >
    > > Currently I just threw out their format and used your solution with
    > > the
    > > if function: =IF(b1>a1,"24:00"-(a1-b1),b1-a1) Maybe I overdid it??
    > > but it seems to work fine.
    > >
    > > Just curious if anyone has ever come across the weird format I
    > > described in the first post. I thought maybe it was some MVP
    > > supersolution
    > >

    >
    >




  6. #6
    Roger Govier
    Guest

    Re: adding/subtracting time

    Indeed I did.
    Thanks for catching the typo, Bob

    --
    Regards

    Roger Govier


    "Bob Phillips" <[email protected]> wrote in message
    news:[email protected]...
    >I think Roger means
    >
    > =MOD(B1-A1,1)
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "Roger Govier" <[email protected]> wrote in message
    > news:[email protected]...
    >> Hi Kat
    >>
    >> With start in A1 and End in B1
    >> =MOD(B1,A1,1)
    >> will deal with either scenario
    >>
    >> --
    >> Regards
    >>
    >> Roger Govier
    >>
    >>
    >> "kat" <[email protected]> wrote in message
    >> news:[email protected]...
    >> > That works great when the time is within the same day, but when it
    >> > starts at 10:00PM and ends at 2:00AM I can't calculate the hours.
    >> >
    >> > Currently I just threw out their format and used your solution with
    >> > the
    >> > if function: =IF(b1>a1,"24:00"-(a1-b1),b1-a1) Maybe I overdid
    >> > it??
    >> > but it seems to work fine.
    >> >
    >> > Just curious if anyone has ever come across the weird format I
    >> > described in the first post. I thought maybe it was some MVP
    >> > supersolution
    >> >

    >>
    >>

    >
    >




+ 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