+ Reply to Thread
Results 1 to 10 of 10

working time minus lunch

  1. #1
    Registered User
    Join Date
    01-19-2012
    Location
    sweden
    MS-Off Ver
    Excel 2007
    Posts
    5

    Question working time minus lunch

    exel shema hjälp.xlsx

    please open attach to read and see my problem..

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: working time minus 30 min lunch.. help needed.

    Perhaps in E7 =D7-C7-QUOTIENT(D7-C7,5)*0.5 (providing time is entered in decimal as you did)

  3. #3
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: working time minus 30 min lunch.. help needed.

    You almost had it, but you could try

    =(D7-C7)-((D7-C7)>=5)*0.5-((D7-C7)>=10)*0.5

  4. #4
    Registered User
    Join Date
    01-19-2012
    Location
    sweden
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: working time minus 30 min lunch.. help needed.

    Quote Originally Posted by Pepe Le Mokko View Post
    Perhaps in E7 =D7-C7-QUOTIENT(D7-C7,5)*0.5 (providing time is entered in decimal as you did)
    Thank you but the problem is still there. I cant enter real time in the "work time" cell, (ex 7:15, 7:30, 7:45) now i have to enter (ex 7,25. 7,5. 7,75)

    Tryed to use =MOD(C7-D7;1)*24 to get the time right but then the other calculation doesnt work.

    I found this youtube link to help me but i donīt want the weekdays in it but perhaps some coding are helpfull.
    http://www.youtube.com/watch?v=CtrFnGWqoGE

  5. #5
    Registered User
    Join Date
    01-19-2012
    Location
    sweden
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: working time minus 30 min lunch.. help needed.

    Thank you but the problem is still there. I cant enter real time in the "work time" cell, (ex 7:15, 7:30, 7:45) now i have to enter (ex 7,25. 7,5. 7,75)

    Tryed to use =MOD(C7-D7;1)*24 to get the time right but then the other calculation doesnt work.

    I found this youtube link to help me but i donīt want the weekdays in it but perhaps some coding are helpfull.
    http://www.youtube.com/watch?v=CtrFnGWqoGE

  6. #6
    Registered User
    Join Date
    01-19-2012
    Location
    sweden
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: working time minus 30 min lunch.. help needed.

    Quote Originally Posted by Bob Phillips View Post
    You almost had it, but you could try

    =(D7-C7)-((D7-C7)>=5)*0.5-((D7-C7)>=10)*0.5
    Thank you but the problem is still there. I cant enter real time in the "work time" cell, (ex 7:15, 7:30, 7:45) now i have to enter (ex 7,25. 7,5. 7,75)

    Tryed to use =MOD(C7-D7;1)*24 to get the time right but then the other calculation doesnt work.

    I found this youtube link to help me but i donīt want the weekdays in it but perhaps some coding are helpfull.
    http://www.youtube.com/watch?v=CtrFnGWqoGE

  7. #7
    Registered User
    Join Date
    01-19-2012
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: working time minus 30 min lunch.. help needed.

    change the display of the numbers to time instead of number
    then input in time format, e.g. 7:30 16:15 or 4:15 pm
    then using the time format as input you can use
    =(D7-C7)-(D7-C7>=5/24)*1/48-(D7-C7>=10/24)*1/48
    the result is right in time format
    multiply this by 24 and display as number instead of time if you want the result in decimal hours
    if you want mixed input of time format and decimal format, you are creating yourself an interesting problem, but you can probably safely assume that anything > 1 was in decimal format and build your checks from that. You cannot be sure of course, so maybe you should first decide what format you actually want.

    Regards

  8. #8
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: working time minus 30 min lunch.. help needed.

    Adapted formula
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    01-19-2012
    Location
    sweden
    MS-Off Ver
    Excel 2007
    Posts
    5

    (Solved) Re: working time minus 30 min lunch.. help needed.

    Thank you 4 all help,

  10. #10
    Forum Contributor
    Join Date
    10-16-2010
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2003, 2010
    Posts
    151

    Re: working time minus 30 min lunch.. help needed.

    This should get your hours in decimal: =((D7-C7)*(1440/60)) after changing the number format to time for the input. So =IF(((D7-C7)*(1440/60))>10,(((D7-C7)*(1440/60))-1),IF(((D7-C7)*(1440/60))>5,(((D7-C7)*(1440/60))-0.5),(D7-C7)*(1440/60))) This worked for me using your sheet. I am not sure I remember why I had to use the 1440/60 to get hours, but that was the only way I could make this work for me in my application.
    Jacob Albers
    Excel 2003 & 2010

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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