+ Reply to Thread
Results 1 to 5 of 5

Calculate number of hours between two dates - Weekdays only

Hybrid View

thjones87 Calculate number of hours... 01-25-2016, 11:26 AM
sourabhg98 Re: Calculate number of hours... 01-25-2016, 11:46 AM
sourabhg98 Re: Calculate number of hours... 01-25-2016, 11:50 AM
thjones87 Re: Calculate number of hours... 01-25-2016, 11:52 AM
sourabhg98 Re: Calculate number of hours... 01-25-2016, 12:01 PM
  1. #1
    Registered User
    Join Date
    01-25-2016
    Location
    Atlanta, GA
    MS-Off Ver
    MS Office 2013
    Posts
    2

    Calculate number of hours between two dates - Weekdays only

    Hello,

    I have been searching for this for a while now. I would like to calculate the difference between two dates, in hours, based off the following information:

    ExcelQuestion.png



    I have seen this post http://www.excelforum.com/excel-form...-weekends.html

    I have also tried this formula: "=NETWORKDAYS(A1,B1)-1-MOD(A1,1)+MOD(B1,1)"

    This would work if I had the date like so:

    ExcelQuestion2.png


    But the way the information is collected is different being that the date and time are in different cells. Otherwise that would work for me. If there is not a viable option, we can always alter a few things in order to make it work, but it would be preferred to have the data captured the current way with no alterations.

    Thank you all for your help!
    Last edited by thjones87; 01-25-2016 at 11:50 AM.

  2. #2
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Calculate number of hours between two dates - Weekdays only

    Hi,
    Welcome to the forum!!

    Try this-
    =(NETWORKDAYS(A1,C1)*24)-IF(NETWORKDAYS(C1,C1)=1,24-HOUR(D1),24)-IF(NETWORKDAYS(A1,A1)=1,HOUR(B1),0)
    Check attached.
    Attached Files Attached Files
    Happy to Help

    How to upload excel workbooks at this forum - http://www.excelforum.com/the-water-...his-forum.html

    "I don't get things easily, so please be precise and elaborate"

    If someone's post has helped you, thank by clicking on "Add Reputation" below the post.
    If your query is resolved please mark the thread as "Solved" from the "Thread Tools" above.

    Sourabh

  3. #3
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Calculate number of hours between two dates - Weekdays only

    okay, I will correct myself.
    Just did a small error
    Change to the formula to this-
    =(NETWORKDAYS(A1,C1)*24)-IF(NETWORKDAYS(C1,C1)=1,24-HOUR(D1),0)-IF(NETWORKDAYS(A1,A1)=1,HOUR(B1),0)

  4. #4
    Registered User
    Join Date
    01-25-2016
    Location
    Atlanta, GA
    MS-Off Ver
    MS Office 2013
    Posts
    2

    Thumbs up Re: Calculate number of hours between two dates - Weekdays only

    My friend, thank you so much for that. That's exactly what I needed! Thank you for knocking it out so quickly!

  5. #5
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Calculate number of hours between two dates - Weekdays only

    You are most welcome friend!!

    Thank you for your feedback and reputation!!

    Have a Great Day!

+ 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. Counting the number of hours within weekdays.
    By rcdiago in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-28-2015, 03:40 AM
  2. Formula to Calculate the Number of Hours Between 2 Dates and Times
    By Squint in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-11-2014, 03:28 PM
  3. How to calculate the number of working hours between 2 dates
    By Rupe in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-04-2014, 12:02 PM
  4. Excel Formula to calculate working hours between two dates excluding weekdays with wh
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-28-2013, 11:20 AM
  5. SUMPRODUCT used to calculate Number of weekdays, returns #VALUE in VBA
    By suchi0508 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-30-2012, 10:02 AM
  6. calculate the number of working hours between two dates
    By sureshchinna_sb in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-29-2012, 09:57 AM
  7. How to calculate number of weekdays vs weekend days
    By nkim99 in forum Excel General
    Replies: 0
    Last Post: 05-31-2011, 02:10 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