+ Reply to Thread
Results 1 to 3 of 3

Calculate working hours between two dates/times

  1. #1
    Registered User
    Join Date
    03-22-2016
    Location
    United States, NC
    MS-Off Ver
    2010
    Posts
    40

    Post Calculate working hours between two dates/times

    I am need the following formula in Microsoft SharePoint to calculate the number of hours between two dates and times, for working hours and exclude the weekends.

    =IF(AND((WEEKDAY([Date & Time Request Ends],2))<(WEEKDAY([Date & Time request Starts],2)),((WEEKDAY([Date & Time request Starts],2))-(WEEKDAY([Date & Time Request Ends],2)))>1),(((DATEDIF([Date & Time request Starts],[Date & Time Request Ends],"D")+1))-(FLOOR((DATEDIF([Date & Time request Starts],[Date & Time Request Ends],"D")+1)/7,1)*2)-2),(((DATEDIF([Date & Time request Starts],[Date & Time Request Ends],"D")+1))-(FLOOR((DATEDIF([Date & Time request Starts],[Date & Time Request Ends],"D")+1)/7,1)*2)))

    I tried adding this to the end of the formula but it didn't work.

    INT(([Date & Time Request Ends]-[Date & Time request Starts])*24)
    Last edited by Drscott21; 04-03-2018 at 01:02 PM. Reason: "Need Help with Sharepoint formula"

  2. #2
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Calculate working hours between two dates/times

    =(NETWORKDAYS(B1,B2)-1)*("20:00"-"8:00")-C1-"12:00"+C2
    row1 -start, row2 -end

  3. #3
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: Calculate working hours between two dates/times

    The following are two user-defined function analogous to WorkDays and NetWorkDays.

    WorkHours (StartDate, NumerofHours, Shift_Start_Time, Shift_End_Time, [Holidays]) - computes end time of job given a start time and number of hours.

    NetWorkHours(Shift_Start_Time, Shift_End_Time, Start_Time, End_Time,[Holidays]) - computes number of hours worked given a start time and end time

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

+ 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. VBA to select SharePoint Content Type when saving Excel file to SharePoint
    By Luffk73 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-24-2017, 05:22 PM
  2. Formula to access the server document properties linked to SharePoint
    By sraoof in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-13-2016, 03:45 AM
  3. Need Help Creating a Letter Grade excel formula to be used in SharePoint.
    By probodyrepair in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 03-13-2015, 04:46 PM
  4. sharepoint formula time and date calculation
    By cmccabe in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-01-2014, 09:00 PM
  5. need help with sharepoint 2013 calculated column formula
    By xxxxmints in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-06-2014, 11:07 PM
  6. Opening SharePoint file with VBA - disable SharePoint "Contacting the server" message
    By kopite2002 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-22-2013, 01:56 AM
  7. Replies: 0
    Last Post: 10-08-2013, 10:54 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