+ Reply to Thread
Results 1 to 4 of 4

Help with formula for hours and days

  1. #1
    Registered User
    Join Date
    08-13-2009
    Location
    Glasgow
    MS-Off Ver
    Excel 2016,2016,365
    Posts
    92

    Help with formula for hours and days

    Hello,

    I have a holiday spreadsheet.

    We are entitled to 200 hours annual leave overall which works out as 25days(8hr days)(Mon-Thursday). But, if you only took Fridays then you could have 40 days as one Friday annual leave is only 5hrs leave and not the 8hrs.

    We are also allowed to take 2hrs off if we wish.

    I am looking for help with a formula that works out how much days and hours I have left available to take.

    My spreadsheet allows me to enter in the start date, end date which works out the number of days(but i need to disregard weekend days) and I can add in how many hours. So,

    For example.
    Start Date End Date Reason Number of Hrs Number of Days
    23 May 2017 25 May 2017 Wedding 8.0(maybe should read 24?) 3

    Subtracting the hours is the easy part but not sure how I get it to display that I have not actually taken a full day(overall) if it is less than 8hrs?
    Also, it probably should display half days which would be 4hrs.

    Hope fully I have attached the spreadsheet correctly.

    Thanks

    Ross
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Help with formula for hours and days

    try networkdays as a function for the number of days.

    The number of days isn't really relevant it you work in hours. You could divide by 8 or (37/5) , or just sum the number of days if you wanted number of days where some leave was taken

    hours should be total hrs ideally

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,228

    Re: Help with formula for hours and days

    Number of Working Days:

    =NETWORKDAYS.INTL($A2,$B2)

    You can add Holidays to this if required.

    Number of Fridays

    =SUMPRODUCT(N(WEEKDAY(ROW(INDIRECT($A2&":"&$B2)))=6))

    For Half days you either simply manually input the hours of code ("F"=Full, "H"=Half)

  4. #4
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Help with formula for hours and days

    =SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A2&":"&B2)),2)<5))*8+SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A2&":"&B2)),2)=5))*5 may work out the number of hours although you would need to overtype for half days

+ 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. Formula which can calculate hours and days in a week
    By anniewalker in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 03-10-2016, 02:01 AM
  2. [SOLVED] Averaging out Days and Hours when formatted to text due to formula
    By kbiro in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 10-23-2015, 02:12 PM
  3. Formula to sum total working hours and convert into days
    By tariqnaz2005 in forum Excel General
    Replies: 1
    Last Post: 04-30-2015, 09:08 AM
  4. Replies: 2
    Last Post: 07-08-2014, 07:00 PM
  5. Processing Time Formula Help (Working days and hours)
    By Petersenkelly in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-13-2012, 10:00 AM
  6. Replies: 7
    Last Post: 05-28-2012, 12:18 PM
  7. Converting hours to 8 hour days, 31 day limit? Formula blows up at 256 hours..
    By krfarmer in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 02-25-2010, 05:21 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