+ Reply to Thread
Results 1 to 14 of 14

Exclude Sunday and Pub holiday

  1. #1
    Registered User
    Join Date
    01-10-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    37

    Exclude Sunday and Pub holiday

    Hi I had this in the Functions sections, but after lots of views no one seems to know if this doable. So i was hoping some coding person could help as i have no idea of how to write code



    Hi I have a calculation, several in fact and basically they check when a test comes in and when it is released. It's measured over 24 hrs, 48 hrs ,72hrs and 72+ hrs.
    I use this to work out the interval
    =(D2+E2)-(B2+C2)

    This is what pulls the number into the time period
    =COUNTIFS('Raw data'!F2:F1667,">01:00",'Raw data'!F2:F1667,"<=24:00")

    So where my problem is that no-one works Sunday or Public holidays, so if a case comes in Friday after noon goes monday afternoon showing as 72 hrs where in effect its should be showing as 48 hrs.
    Is there away that case that run over a Sunday or pub holiday take those hours of?

    I have attached the file just in case you more clarification.

    Any help is really appreciated, i am right under the pump now/
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    01-19-2010
    Location
    Melbourne Australia
    MS-Off Ver
    latest is Excel 2016. have older versions
    Posts
    624

    Re: Exclude Sunday and Pub holiday

    Hi Frazzle6

    quick question, where does the raw data come from and how does it get into the "Raw Data" tab please (is it possible to alter the format of the cells for example?)
    JMAC

  3. #3
    Registered User
    Join Date
    01-10-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    37

    Re: Exclude Sunday and Pub holiday

    I use SQL developer to pull the data then export into excel. I rename the tab to Raw data.

  4. #4
    Valued Forum Contributor
    Join Date
    01-19-2010
    Location
    Melbourne Australia
    MS-Off Ver
    latest is Excel 2016. have older versions
    Posts
    624

    Re: Exclude Sunday and Pub holiday

    can you pull the date & time as one field rather than two separate fields for each of start & finish

  5. #5
    Registered User
    Join Date
    01-10-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    37

    Re: Exclude Sunday and Pub holiday

    I'm not sure does it make a huge diffrerence?, i can have a go at it

  6. #6
    Valued Forum Contributor
    Join Date
    01-19-2010
    Location
    Melbourne Australia
    MS-Off Ver
    latest is Excel 2016. have older versions
    Posts
    624

    Re: Exclude Sunday and Pub holiday

    wait a bit, i am having a play with the test data now, making some progress (I think)

  7. #7
    Registered User
    Join Date
    01-10-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    37

    Re: Exclude Sunday and Pub holiday

    excellent if you can help, tried joining the fields, crashed the query

  8. #8
    Valued Forum Contributor
    Join Date
    01-19-2010
    Location
    Melbourne Australia
    MS-Off Ver
    latest is Excel 2016. have older versions
    Posts
    624

    Re: Exclude Sunday and Pub holiday

    OK,

    if the:

    start date = 23/12/2013
    start time = 23:36

    finish date = 27/12/2013
    finish time = 23:43

    what are you expecting to see as the result (Australian public holidays used 25 & 26/12)

    Jmac

  9. #9
    Registered User
    Join Date
    01-10-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    37

    Re: Exclude Sunday and Pub holiday

    I would like to that to say the interval is 48:07.

  10. #10
    Valued Forum Contributor
    Join Date
    01-19-2010
    Location
    Melbourne Australia
    MS-Off Ver
    latest is Excel 2016. have older versions
    Posts
    624

    Re: Exclude Sunday and Pub holiday

    TAT Hist2.xlsx

    I hate time and date "stuff" in excel, I never seem to be able to get it to do what I want

    take a look at the attached. I have attempted to break the problem down to simple steps using helper cells and I can see the right answer... if only I could get the minutes < 10 to be two digits, can change the display format but not it seems the concatenate function

    workdays seems to include the starting date hence the -1 in the formula

    very close, let me know how you go

    jmac

  11. #11
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Exclude Sunday and Pub holiday

    Pl see attached file.
    Attached Files Attached Files
    Last edited by kvsrinivasamurthy; 01-23-2014 at 03:32 AM.

  12. #12
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Re: Exclude Sunday and Pub holiday

    Hi Guys,

    This one has had me scratching my head.

    I have added some helper columns to avoid a monster formula

    Col H:I are for interest

    Column J uses NETWORKDAYS, and I have put the Public Holidays for NSW on a separate sheet.
    Column M is my attempt to calculate the days to take off. Effectively Public Holidays and Sundays.

    The problem with the NETWORKDAYS formula is that it doesn't count Saturday as a workday. Therefore we have to add back Saturdays. I have attempted to do that in column L.

    The next problem is that I was expecting there to be no Sundays in your data, because you don't work on Sunday. Wrong! There are quite a few, and I don't know how to treat them or get around this issue.

    Anyway

    Let me know how you progress.


    Frazzle6 - TAT Histo.xlsx

    Regards, David


    When you reply please make it clear WHO you are responding to by mentioning their name.
    If this has been of assistance, please advise. A little thanks goes a long way.
    - Please click on the *Add Reputation button at the bottom of helpful responses.
    Please mark your thread as SOLVED:
    - Click Thread Tools above your first post, select "Mark your thread as Solved".

  13. #13
    Valued Forum Contributor
    Join Date
    01-19-2010
    Location
    Melbourne Australia
    MS-Off Ver
    latest is Excel 2016. have older versions
    Posts
    624

    Re: Exclude Sunday and Pub holiday

    hi David,

    networkdays.intl actually allows you specifY saturday as a workday

    I havent checked out kvsrinivasamurthy latest post yet but on first impressions it assumes sat/sun as non working days... need to check the code further

    like where kvsrinivasamurthy is heading however

  14. #14
    Registered User
    Join Date
    01-10-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    37

    Re: Exclude Sunday and Pub holiday

    Hi Guys, thanks so much for all your help, really do appreciate it. A developer from the UK came through with coding that does the trick.

+ 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. Exclude Sunday and Pub holiday
    By Frazzle6 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-23-2014, 12:12 AM
  2. Saturday, Sunday or Holiday BY-PASS
    By GPErtel in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-19-2013, 08:26 PM
  3. [SOLVED] Date should exclude holiday which saved separately at sheet 2.
    By ExcelUser2707 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-21-2013, 01:26 AM
  4. Find how many date between two dates but excluding Sunday and holiday
    By tantcu in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-05-2013, 05:06 PM
  5. Next valid date, exclude holiday / Sat / Sun
    By phil77 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-27-2010, 04:56 PM

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