+ Reply to Thread
Results 1 to 3 of 3

Time Diffrence Formula To Exclude Gaps Time Between 5PM - 8AM

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-08-2013
    Location
    Jacksonville, Fl
    MS-Off Ver
    Excel 2016
    Posts
    355

    Time Diffrence Formula To Exclude Gaps Time Between 5PM - 8AM

    Hello everyone,

    I need a help with a formula or macro that will display the difference between two dates. But it will not count time between 5pm and 8am.

    For example:
    Range A2 9/22/14 10:00AM
    Range B2 9/23/14 2:00PM

    The formula should return 13 hours

    I would also need weekends to not be included.

    Is this possible with a formula?

    Thank you,

    -Justin
    Last edited by Justair07; 09-22-2014 at 08:47 AM.

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,446

    Re: Time Diffrence Formula To Exclude Gaps Time Between 5PM - 8AM

    Hi,

    This should yield the result you need, assuming that your start and end dates are within working hours.

    =(NETWORKDAYS(A2,B2)-1)*9/24+MOD(B2,1)-MOD(A2,1)


    Remember to format your result as [hh]:mm
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Forum Contributor
    Join Date
    01-08-2013
    Location
    Jacksonville, Fl
    MS-Off Ver
    Excel 2016
    Posts
    355

    Re: Time Diffrence Formula To Exclude Gaps Time Between 5PM - 8AM

    Perfect. Thank you sweep!

+ 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: 04-02-2014, 10:38 AM
  2. [SOLVED] calculation of time diffrence
    By grkchakri in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-14-2013, 08:06 AM
  3. how to find time diffrence d/w two dates
    By komalmanohar in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-29-2011, 12:24 PM
  4. How to use formula to exclude time series.
    By graphicwizard28 in forum Excel General
    Replies: 1
    Last Post: 05-09-2010, 12:57 AM
  5. [SOLVED] Cells with time format and calculating the diffrence
    By MikeR-Oz in forum Excel - New Users/Basics
    Replies: 11
    Last Post: 01-03-2006, 06:15 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