+ Reply to Thread
Results 1 to 6 of 6

Removing lunch hour from Log Sheet. (Removing Specific Hour duration)

  1. #1
    Registered User
    Join Date
    08-09-2018
    Location
    M.E.
    MS-Off Ver
    2016
    Posts
    9

    Exclamation Removing lunch hour from Log Sheet. (Removing Specific Hour duration)

    Hello!

    Been trying to workout a formula that would remove the lunch time duration from the logsheet total off or leave duration. But it's not a standardized -1 hour.

    What i mean is:
    Lunch hour is from 11:30 to 12:30

    Example 1 : Out: 11:00 In: 12:15
    So, leave duration should be 30 minutes.

    Example 2: Out 11:45 In 12:45
    Leave hours should be 15 min.

    Example 3: Out 09:00 In: 12:50
    Leave hours should be 2 hours and 50 Minutes

    I would appreciate the help as I'm still trying to figure out how to correctly make it work.
    Last edited by SirTypos; 08-09-2018 at 07:47 AM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Removing lunch hour from Log Sheet. (Removing Specific Hour duration)

    Hi, welcome to the forum

    If it is not a standard 1 hour, then what is it/what could it be?

    What you need to understand about dates and times in excel is…

    a date is just a number representing the number of days passed since 1/1/900...and then formatted in a way that we recognize as a date. So, for instance, today (Thu 09 Aug 2018) is actually 43321

    Time is actually a decimal part of 1 (day), so 06:00 AM is 0.25, 12 noon is 0.5 and 18:00 (or 6 PM) is 0.75
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    08-09-2018
    Location
    M.E.
    MS-Off Ver
    2016
    Posts
    9

    Re: Removing lunch hour from Log Sheet. (Removing Specific Hour duration)

    What I need to make Excel understand is to check the logout & login time of the employee. Then to check if login or logout time fell in the lunch hour period which is from 11:30 to 12:30 or if occured within the lunch hour. Then it would minus whatever number of minutes that the employee was out if it fell on the lunch hour.

    Example: loged out on 11:15 then logged in on 12:15
    Excel would recognise that 11:15 did not fall on lunch hour
    But 12:15 is during the lunch hour.

    Thus, employee wasn't around at the start of the lunch hour which is 11:30.

    So, calculation would go on getting the minutes from 11:15 to 11:30 which is 15 minutes

    Then ignore the minutes from 11:30 to 12:15 because it's lunch.

    If the employee came back on 12:45.

    Then it would start calculating from 12:30 to 12:15 which is another 15 Minutes

    But i can't figure out how to make excel recognizing the hours and do the calculation

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,934

    Re: Removing lunch hour from Log Sheet. (Removing Specific Hour duration)

    Please provide some sample data for us to work within a dummy workbook (desensitised data). Manually mock up your expected results.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    08-09-2018
    Location
    M.E.
    MS-Off Ver
    2016
    Posts
    9

    Re: Removing lunch hour from Log Sheet. (Removing Specific Hour duration)

    Sorry for the delay

    Uploaded an example of the end result
    Hope it's good to explain

    Note that example 1,2,6 is Normal duration. Just to give an idea.

    Tried to break it down and making it realize what is the time out & in in multiple columns but it would just not work!!

    Such Frustration.
    Attached Files Attached Files
    Last edited by SirTypos; 08-27-2018 at 08:38 AM.

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,570

    Re: Removing lunch hour from Log Sheet. (Removing Specific Hour duration)

    This proposed solution places the lunch start time in cell start time in cell E2 and the lunch end time in cell E3.
    The formula that populates D2, which may then be copied down to D7, is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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: 2
    Last Post: 12-24-2015, 03:00 PM
  2. Replies: 1
    Last Post: 07-03-2015, 06:57 AM
  3. [SOLVED] Formula to automatically adjust lunch hour based on start time
    By Zyphon in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-26-2015, 07:23 AM
  4. Bar Stock Graph 24 Hour Duration
    By thermometer in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 10-18-2014, 08:39 PM
  5. [SOLVED] Automatically exclude 1 hour lunch break
    By samaine in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-16-2013, 12:20 AM
  6. time calculation without lunch hour
    By Harrold in forum Excel General
    Replies: 7
    Last Post: 01-29-2012, 02:49 AM
  7. Replies: 1
    Last Post: 11-24-2011, 05:01 PM

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