+ Reply to Thread
Results 1 to 24 of 24

Returning next day (including weekends but excluding holidays)

  1. #1
    Registered User
    Join Date
    06-07-2019
    Location
    Leeds, England
    MS-Off Ver
    Excel for Office 365 16.0.10730.20264 32 Bit
    Posts
    16

    Returning next day (including weekends but excluding holidays)

    Hi

    I am relatively new to the forum, and am usually OK with formulas but this one is causing me no end of problems.
    I was looking at another post that was similar and used workday.intl, but couldnt get it to work.

    Scenario
    - Maintenance Inspections are carried out every 4 weeks. I need to show both the next actual date and a proposed date in case it is a public holiday. I can get the next date returned ok, but if it is a holiday I want it to move to the next working day.

    The formula I have used is =WORKDAY.INTL(G4,0,"0000000",PublicHols)
    G4 is my first date
    Publichols is a named range for public holidays
    I need the next date to be in J4

    If I use =WORKDAY.INTL(G4,1,"0000000",PublicHols) it works, but adds on a day - which isnt what I want. I only want to add days if it is a public holiday

    Sorry for the long post

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: Returning next day (including weekends but excluding holidays)

    See if this works:

    =WORKDAY(G4,1,-1,PublicHols)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    06-07-2019
    Location
    Leeds, England
    MS-Off Ver
    Excel for Office 365 16.0.10730.20264 32 Bit
    Posts
    16

    Re: Returning next day (including weekends but excluding holidays)

    thanks Ali, but unfortunately that didnt work - it returned an error "You've entered too many arguments for this function"

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: Returning next day (including weekends but excluding holidays)

    That's odd, as I have used something similar before.

    Please attach a sample workbook (desensitised)

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Last edited by AliGW; 07-25-2019 at 06:30 AM.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: Returning next day (including weekends but excluding holidays)

    What does this give you?

    =WORKDAY(G4,1,PublicHols)

  6. #6
    Registered User
    Join Date
    06-07-2019
    Location
    Leeds, England
    MS-Off Ver
    Excel for Office 365 16.0.10730.20264 32 Bit
    Posts
    16

    Re: Returning next day (including weekends but excluding holidays)

    Workbook attached - thanks for helping
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    06-07-2019
    Location
    Leeds, England
    MS-Off Ver
    Excel for Office 365 16.0.10730.20264 32 Bit
    Posts
    16

    Re: Returning next day (including weekends but excluding holidays)

    Hi

    =WORKDAY(G4,1,PublicHols) returns the next day, but I only want this if it is a public holiday, if it isnt I want to preserve the original date

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: Returning next day (including weekends but excluding holidays)

    We need your workbook with the holiday range in it, please.

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: Returning next day (including weekends but excluding holidays)

    The named range is not correct - it is missing the first date - so try this:

    =IF(ISNA(MATCH(G4,$T$5:$T$33,0)),G4,G4+1)

  10. #10
    Registered User
    Join Date
    06-07-2019
    Location
    Leeds, England
    MS-Off Ver
    Excel for Office 365 16.0.10730.20264 32 Bit
    Posts
    16

    Re: Returning next day (including weekends but excluding holidays)

    Thank you AliGW, but it doesnt work. If I change the date in G4 to 25th December 2019 the formula returns the date of 26th December 2019 which is in the 'list' of holidays. I think we need to use a variation of

    =WORKDAY.INTL(G4,1,"0000000",PublicHol)

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: Returning next day (including weekends but excluding holidays)

    OK - but the problem is you are drip-feeding information. We can only offer solutions based on what you tell us, not based on what you don't tell us.

    Have you fixed your named range?

  12. #12
    Registered User
    Join Date
    06-07-2019
    Location
    Leeds, England
    MS-Off Ver
    Excel for Office 365 16.0.10730.20264 32 Bit
    Posts
    16

    Re: Returning next day (including weekends but excluding holidays)

    Hi
    I have changed the daterange. I will attache the updated file.

    In my original post I mentioned that I wanted to add days if it was a public holiday

  13. #13
    Registered User
    Join Date
    06-07-2019
    Location
    Leeds, England
    MS-Off Ver
    Excel for Office 365 16.0.10730.20264 32 Bit
    Posts
    16

    Re: Returning next day (including weekends but excluding holidays)

    updated file attached
    Attached Files Attached Files

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: Returning next day (including weekends but excluding holidays)

    Yes, you said you wanted to add a day if it was a public holiday. However, at no point have you provided us with an indication of your expected outcomes.

    Please provide a sample data set with JUST December dates. Instead of the column with the failing formula, manually type in the dates you want returned. Thanks.

  15. #15
    Registered User
    Join Date
    06-07-2019
    Location
    Leeds, England
    MS-Off Ver
    Excel for Office 365 16.0.10730.20264 32 Bit
    Posts
    16

    Re: Returning next day (including weekends but excluding holidays)

    HI

    I have attached the updated spreadsheet and included dates for August and December

    I have also added columns to show the date with the formula, the expected date and a comments column
    Attached Files Attached Files

  16. #16
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: Returning next day (including weekends but excluding holidays)

    I think this does it:

    =IF(ISNA(MATCH(G4,PublicHols,0)),G4,WORKDAY(G4,1,PublicHols))

  17. #17
    Registered User
    Join Date
    06-07-2019
    Location
    Leeds, England
    MS-Off Ver
    Excel for Office 365 16.0.10730.20264 32 Bit
    Posts
    16

    Thumbs up Re: Returning next day (including weekends but excluding holidays)

    That works - thank you so much ...

  18. #18
    Registered User
    Join Date
    06-07-2019
    Location
    Leeds, England
    MS-Off Ver
    Excel for Office 365 16.0.10730.20264 32 Bit
    Posts
    16

    Re: Returning next day (including weekends but excluding holidays)

    virtual boquet of flowers on its way to you (and a bottle of wine)

  19. #19
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: Returning next day (including weekends but excluding holidays)

    Not so fast!

    I think it might exclude weekends, but this one should work:

    =G5+2-NETWORKDAYS.INTL(G5,G5+1,"0000000",PublicHols)

    PS Elderflower spritzer, please - I'm TT!!!

  20. #20
    Registered User
    Join Date
    06-07-2019
    Location
    Leeds, England
    MS-Off Ver
    Excel for Office 365 16.0.10730.20264 32 Bit
    Posts
    16

    Re: Returning next day (including weekends but excluding holidays)

    Elderflower spritzer on its virtual way (that would be so cool and refreshing in this heat).

    Unfortunately the revised formula doesnt work in row 6 (24th december should return 24th december but returns 25th december which is in the list) strange because all other dates seem to work.

  21. #21
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: Returning next day (including weekends but excluding holidays)

    OK - let's try this, then:

    =IF(ISNA(MATCH(G5,PublicHols,0)),G5,G5+2-NETWORKDAYS.INTL(G5,G5+1,"0000000",PublicHols))

  22. #22
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,908

    Re: Returning next day (including weekends but excluding holidays)

    One way:

    =WORKDAY.INTL(G4-1,1,"0000000",PublicHols)

  23. #23
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: Returning next day (including weekends but excluding holidays)

    I think that's what I was trying to do before! However, it doesn't work as requested for Sat 28 Dec, which should come out as Mon 30 Dec, if I have i=understood correctly.

  24. #24
    Valued Forum Contributor
    Join Date
    04-26-2015
    Location
    Toronto, Canada
    MS-Off Ver
    2010
    Posts
    502

    Re: Returning next day (including weekends but excluding holidays)

    I think this one works
    Using named ranges 1 for actual holiday dates and one for adjusted work dates.
    Please Login or Register  to view this content.
    It uses a Perpetual Public Holiday Calendar for the holiday dates and adjustments for New Year and Christmas.
    Attached Files Attached Files
    Last edited by BlindAlley; 07-26-2019 at 12:34 PM.
    Uploading an attachment will assist Forum Members in finding the correct Solution for you. Create a dummy worksheet if necessary, add your start data and show where / what your expected results should be. TO ADD A FILE:

    Go to 'Advanced. click on 'Manage Attachments. Select 'Browse & Choose your file, Select 'Upload and then close the Attachment window.

+ 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. Business Days in a Month Excluding Holidays, Including Weekends
    By jenniescharms in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-25-2019, 10:42 AM
  2. Formula Counting Days Including weekends, excluding Holidays
    By Stevenvc19 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-08-2019, 09:00 AM
  3. Excluding weekends and holidays
    By mindy2017 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-26-2018, 10:35 PM
  4. Excluding weekends and holidays from chart
    By Jogier505 in forum Excel General
    Replies: 2
    Last Post: 12-07-2010, 04:44 PM
  5. List Dates Excluding Holidays but Including weekends
    By GuyHudson in forum Excel General
    Replies: 6
    Last Post: 09-22-2010, 05:58 AM
  6. Workday With Weekends Excluding Holidays
    By Chuy in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-18-2006, 04:04 PM
  7. [SOLVED] Re: Dates not including weekends and holidays
    By Ron de Bruin in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-13-2005, 06:05 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