+ Reply to Thread
Results 1 to 8 of 8

Adding up Hours from two different times, minus lunch hour

  1. #1
    Registered User
    Join Date
    12-19-2021
    Location
    Rome, NY
    MS-Off Ver
    Office 365
    Posts
    4

    Adding up Hours from two different times, minus lunch hour

    I have 2 drop-down time selectors from a named range in 2 adjacent cells. Cell 1 is the start-time, cell 2 is the end-time. Cell 3 needs to be the sum of hours (and 1/2 hour if selected) between the two times. However, if the start-time and the end-time span over 12:00pm to 1:00pm, I need to subtract the lunch hour (which is the standard hour and doesn't change). For example if the start-time is 10:00am and the end-time is 2:00pm, the total hours needs to be 3 hours, not 4 hours. Any help would be greatly appreciated! Thank you!

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

    Re: Adding up Hours from two different times, minus lunch hour

    Welcome to the forum

    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Adding up Hours from two different times, minus lunch hour

    Hi and welcome to the forum.

    I'm not sure what you mean by this bit.
    Quote Originally Posted by JCI2112 View Post
    (and 1/2 hour if selected)
    Selected where/how?

    Perhaps attaching a sample workbook showing your data layout and expected results in different scenarios would be useful.

    BSB

  4. #4
    Registered User
    Join Date
    12-19-2021
    Location
    Rome, NY
    MS-Off Ver
    Office 365
    Posts
    4

    Re: Adding up Hours from two different times, minus lunch hour

    Sample spreadsheet is attached.
    Attached Files Attached Files

  5. #5
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Adding up Hours from two different times, minus lunch hour

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


    You still haven't explained what you meant about the half hour if selected though...

    BSB

  6. #6
    Registered User
    Join Date
    12-19-2021
    Location
    Rome, NY
    MS-Off Ver
    Office 365
    Posts
    4

    Re: Adding up Hours from two different times, minus lunch hour

    I just meant that the start-time or end-time could be on the half-hour, not the just the whole hour. eg, 10:30 to 3:30.

  7. #7
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Adding up Hours from two different times, minus lunch hour

    Aha, that makes more sense now.

    The formula in post #5 should work for you then.

    BSB

  8. #8
    Registered User
    Join Date
    12-19-2021
    Location
    Rome, NY
    MS-Off Ver
    Office 365
    Posts
    4

    Re: Adding up Hours from two different times, minus lunch hour

    Works perfect! Thank you!

+ 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. Getting the total amount of Lunch hours between 2 different dates&times
    By kamuskaizen in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-01-2021, 03:56 AM
  2. Timesheet formula to subtract 1/2 a hour lunch only if 6 hours are worked
    By MrsBoot in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-20-2020, 01:55 PM
  3. Replies: 1
    Last Post: 07-03-2015, 06:57 AM
  4. [SOLVED] Adding Hours Worked minus lunch break IF over 5 hours
    By Gtrtim112 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-15-2013, 11:16 PM
  5. Total Working Hours Minus Break + Lunch Times
    By Rosco88 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-13-2013, 05:01 AM
  6. Replies: 8
    Last Post: 06-11-2013, 05:34 PM
  7. [SOLVED] Formula to work out hours between 2 dates and times.. MINUS Out Of Hours
    By chris.m in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-30-2012, 08:11 AM

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