+ Reply to Thread
Results 1 to 9 of 9

Formulas involving time...

  1. #1
    Forum Contributor
    Join Date
    03-24-2010
    Location
    North West UK
    MS-Off Ver
    2013
    Posts
    112

    Formulas involving time...

    Hi All,

    I'm trying to construct a spreadsheet but have hit a stumbling block (spreadsheet attached).

    What I'm trying to do is log drivers details and the hours they have worked. I want to enter the start time and the end time and get the sheet to do the rest.

    However, if let's say the driver started at 14:00 and ended his shift on 03:00 then the simple formula =sum(cell containing 03:00-cell containting 14:00) brings a negative number which is giving ######### in the cell. So I've tried this formula:

    =IF(C3>D3,C3-D3,"-"&TEXT(ABS(C3>D3),"[h]:mm"))

    Which seems to work.

    However, with using this formula with values that would not usually give a negative number I'm getting the result of -0:00.

    Can anyone help before I chuck this PC out the window?

    Thanks
    Lewis
    Attached Files Attached Files
    Last edited by Finalfrontier1976; 05-27-2010 at 10:32 AM.

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Formulas involving time...

    try =IF(A1>B1,B1+1-A1,B1-A1) ( adapt cell ref as needed)

  3. #3
    Forum Contributor
    Join Date
    03-24-2010
    Location
    North West UK
    MS-Off Ver
    2013
    Posts
    112

    Re: Formulas involving time...

    Thanks,

    But, that formula works ok with positive results but not negative times where the finish time (in 24hr clock is less than the start time).

  4. #4
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Formulas involving time...

    Works OK for me where A1 is start and B1 is end

  5. #5
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Formulas involving time...

    Sheet added ( hope it's OK worked with OpenOffice) - Maybe ; should be changed to ,
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    03-24-2010
    Location
    North West UK
    MS-Off Ver
    2013
    Posts
    112

    Re: Formulas involving time...

    Great,

    It works now, must have been me.

    Thank you.

  7. #7
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Formulas involving time...

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  8. #8
    Forum Contributor
    Join Date
    03-24-2010
    Location
    North West UK
    MS-Off Ver
    2013
    Posts
    112

    Re: Formulas involving time...

    Cont...

    One last question, further to this I've been asked then to take the time worked and minus 8hrs from it to give me the overtime amount of hours.

    That I can do no problem as the basic rate is in another colum so it's just a case of say:

    In cell A3 overtime worked would be:

    =sum(a1 (total hours worked) - a2 (8hrs basic pay) )

    What I would like to do then from this overtime amount worked is minus 45mins which is their break period. I've tired a few things but no joy, for example:

    =sum(a3-00:45) but I'm now getting erros.

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Formulas involving time...

    Try

    =A3-Time(0,45,0)

    or A3-0.75
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

+ 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