+ Reply to Thread
Results 1 to 5 of 5

Time formula for late work hours

  1. #1
    Registered User
    Join Date
    03-25-2019
    Location
    Bodø, Norway
    MS-Off Ver
    Office 2016
    Posts
    3

    Time formula for late work hours

    Hi,

    Im new here, but I need to ask about two things concerning the time function.

    As you can see on the picture, I have an opening hour and a closing hour scheduled.
    To quickly explain the terms. Timer means hours, and kveld/helg means evening/weekend.

    timeschedule.png


    Question is:

    1) Why is the first time showing 3,0 and not 3,25?
    2) Whats the obvious formula to actually count in hours that is evening (after 17:00)? The hours written now is just pushed in manually.
    3) Whats the simplest formula to count hours between two times?


    Please help.

  2. #2
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Time formula for late work hours

    Hi and welcome.

    First thing. to learn here.. upload example files, not pictures.. Debugging pictures is often very difficult.

    to answer your questions based on picture only.

    1) because using TIME function is not needed, worse it causes the error. simply use E4-D4 to find the hours between "fra"and "Til"
    2) formula could be

    for time notation
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    or for decimal value
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    3) see 1:, but if you want it to show as decimal value 3,25 then multiply by 24 =(E4-D4)*24

    if you also have to (til) times after midnight then you need a slightly more complicated formula

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    where the (E4<D4) will add 1 to E4 to be bigger then D4.
    Times in excel are fractions of 1
    so 6:00 equals 0,25 and 18:00 equals 0,75
    when the end time is smaller then the begin time then you get a negative value and times cannot be negative therefore you need to make the endtime bigger (by adding 1) to get a correct time worked.

  3. #3
    Registered User
    Join Date
    03-25-2019
    Location
    Bodø, Norway
    MS-Off Ver
    Office 2016
    Posts
    3

    Re: Time formula for late work hours

    Works perfectly, thank you!

  4. #4
    Registered User
    Join Date
    03-25-2019
    Location
    Bodø, Norway
    MS-Off Ver
    Office 2016
    Posts
    3

    Re: Time formula for late work hours

    Another question while were at it. What if I have someone starting after 17, lets say 19 and ends at 23? With this formula I get 6 h since Im counting from 17. Correct answer would be 4 obviously. Since hes working 4 h. and all at night.

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

    Re: Time formula for late work hours

    Why are you counting from 17?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 08-12-2017, 01:48 AM
  2. [SOLVED] IF Function for Time Segments (Work day, late evening, early morning)
    By ExcelNewbee007 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-12-2017, 10:35 AM
  3. Replies: 1
    Last Post: 06-10-2016, 11:38 PM
  4. [SOLVED] Time calculation for attendance, tardy/late to work?
    By Hanr3 in forum Excel General
    Replies: 7
    Last Post: 12-08-2015, 06:16 AM
  5. Formula to work out deductions based on hours and time
    By elmobram22 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-17-2013, 12:13 PM
  6. Replies: 0
    Last Post: 11-12-2012, 04:49 AM
  7. [SOLVED] Work Out If Finish Date/Time is Late - Excel 2003
    By db1966 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-01-2010, 11:48 AM

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