+ Reply to Thread
Results 1 to 24 of 24

Exclude Holidays in Total

  1. #1
    Forum Contributor
    Join Date
    07-28-2015
    Location
    london
    MS-Off Ver
    Microsoft Office 365
    Posts
    113

    Exclude Holidays in Total

    Hi,

    I can total all columns by simply adding SUM formula, but what I don't know is, if a date in a column falls on a holiday then it should not be counted as part of the total taken.

    I can subtract the column if it falls on a holiday, but not all holidays are on the same column, also every year the holidays falls on a different day/date from Jan - Dec.

    This is what I'm trying to achieve:

    A holiday is counted if given or filled, but doesn't need to be taken away from the entitlement. So it will only count the number of week days, weekends, and total taken. The holidays is counted on its own.

    I have attached a sample of what I was trying to achieve.

    Thank you very much in advance.
    Attached Files Attached Files

  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,927

    Re: Exclude Holidays in Total

    Jan AO4 - just change the formula to this:

    =SUM(D5:AH5)-AK3

    You ought to have asked this in the original thread: https://www.excelforum.com/excel-gen...-weekends.html
    Attached Files Attached Files
    Last edited by AliGW; 03-11-2024 at 03:00 AM. Reason: Mod note added.
    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
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Exclude Holidays in Total

    @sikreto
    I guess your requirement isn't as straightforward as the formula in #2.
    Is it like this:
    AK2:AN2 shouldn't actually appear in the worksheet; they are just intermediate steps. And your goal is AO3 and AP3, calculated directly without intermediaries, right?
    Quang PT

  4. #4
    Forum Contributor
    Join Date
    07-28-2015
    Location
    london
    MS-Off Ver
    Microsoft Office 365
    Posts
    113

    Re: Exclude Holidays in Total

    Hi AliGW,

    Thanks for your response. The other post I have was about a different topic and I have just used the same sample workbook, I hope this is ok.

    @bebo021999, I need AO3 and AP3 only.

    AK3 will only be counted totally separate and does not require to be taken away from AO3 and AP3.

    I feel like having a MATCH formula may work not to include the dates in AO3 and AP3 if filled but I don't know where to fit it in.

    Appreciate all your help.

    Thank you.
    Last edited by sickreto; 03-11-2024 at 05:48 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,927

    Re: Exclude Holidays in Total

    But it is not the case of changing the column to subtract, as my template has a format of days of the month where a year may change then the holidays will fall on a different column.
    Can't see from the sample workbook how that would make any difference at all.

  6. #6
    Forum Contributor
    Join Date
    07-28-2015
    Location
    london
    MS-Off Ver
    Microsoft Office 365
    Posts
    113

    Re: Exclude Holidays in Total

    Hi,

    Thanks for looking into this. But I think I got it sorted.
    Apologies for the confusion. I was confused myself .
    As always, thank you very much for a very kind support.

  7. #7
    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,927

    Re: Exclude Holidays in Total

    Glad to have helped.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, remember that you can reward anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

  8. #8
    Forum Contributor
    Join Date
    07-28-2015
    Location
    london
    MS-Off Ver
    Microsoft Office 365
    Posts
    113

    Re: Exclude Holidays in Total

    Hey guys,

    Sorry I'm re-opening this thread.

    I think I know now where I got confused earlier :-)

    Anyway, I will give it a try again to explain what I'm trying to achieve.

    So, I need to calculate the total of Weekdays and Weekend and should give me a total of what was taken and will show me the total balance.

    But here is the challenge, the holidays may fall on any day, and holiday may fall on a weekend, if you can see, I count the number of weekends too, so if the holiday falls on a weekend I can't take it away. The holiday should be counted if filled for the year, but if it falls on a weekend, my formula counts it as a weekend and a holiday count.

    I hope I have explained it well. If not please let me know and I will try to explain it with a better scenario.

    Thank you in advance.
    Last edited by sickreto; 03-11-2024 at 04:36 PM.

  9. #9
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: Exclude Holidays in Total

    A formula to not count holiday if it falls on weekend.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    07-28-2015
    Location
    london
    MS-Off Ver
    Microsoft Office 365
    Posts
    113

    Re: Exclude Holidays in Total

    Hi DJunqueira,

    Thank you for checking on this.

    But I think I didn't explain it well. Apologies for the confusion.

    What I'm trying to achieve is:

    On January sheet, the Holiday falls on a weekend, therefore Holiday Count column should have a count if Row 6 is filled. Then weekdays counts the weekdays, but if holiday is on a weekday then it doesn't count as part of the weekdays but it is counted for the Holiday count. Then Weekend Count column should only count if Row 6 is filled but if the Holiday is on the weekend then it should be added on the Holiday Count column only and not added in the Weekend count column only if it is a holiday.

    I hope this explains well.

    Thank you.

  11. #11
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: Exclude Holidays in Total

    It is much better if you show the expected result in the sheet.
    By the way with the pointed results of 'Total Taken' and 'Balance' the formula bellow works fine.

    AK5
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    AO5
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by DJunqueira; 03-11-2024 at 06:10 PM.

  12. #12
    Forum Contributor
    Join Date
    07-28-2015
    Location
    london
    MS-Off Ver
    Microsoft Office 365
    Posts
    113

    Re: Exclude Holidays in Total

    Hi,

    Please see sample of what I was trying to achieve.

    Thanks in advance.
    Attached Files Attached Files

  13. #13
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Exclude Holidays in Total

    My formula is in row 4, in green cells
    Holiday count:
    Please Login or Register  to view this content.
    Weekday count
    Please Login or Register  to view this content.
    Weekend count:
    =Weekend count - Holiday falls in Weekend
    Please Login or Register  to view this content.
    Hope it works
    Attached Files Attached Files

  14. #14
    Forum Contributor
    Join Date
    07-28-2015
    Location
    london
    MS-Off Ver
    Microsoft Office 365
    Posts
    113

    Re: Exclude Holidays in Total

    Hi bebo021999,

    Thank you very much. Your formula works, but it only works if the holiday falls on a weekend.

    On the same formula, I would also wanted to count it if the holidays falls on a weekdays. When I changed the date, and the holiday falls on a weekday it is then counted as part of the weekday but I need to separate it.

    Any chance on giving a light on that please?

    Thank you.
    Last edited by sickreto; 03-12-2024 at 04:51 AM.

  15. #15
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Exclude Holidays in Total

    Yes, add more SUMPRODUCT for weekday

    Please Login or Register  to view this content.

  16. #16
    Forum Contributor
    Join Date
    07-28-2015
    Location
    london
    MS-Off Ver
    Microsoft Office 365
    Posts
    113

    Re: Exclude Holidays in Total

    Hi,

    I tried the formula and it's giving me a negative answer if the holiday falls on a weekday. And if I add your last formula, it's giving me zero.

    I'm not sure now what part of the formula needs adjustment.

    Thanks.

  17. #17
    Forum Contributor
    Join Date
    07-28-2015
    Location
    london
    MS-Off Ver
    Microsoft Office 365
    Posts
    113

    Re: Exclude Holidays in Total

    Hi,

    I'm attaching another sample explaining and showing what I'm trying to achieve.

    Any help is greatly appreciated.

    Thank you.
    Attached Files Attached Files

  18. #18
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Exclude Holidays in Total

    Try again:
    Weekday
    Please Login or Register  to view this content.
    Weekend
    Please Login or Register  to view this content.
    Attached Files Attached Files

  19. #19
    Forum Contributor
    Join Date
    07-28-2015
    Location
    london
    MS-Off Ver
    Microsoft Office 365
    Posts
    113

    Re: Exclude Holidays in Total

    Thank you very much bebo021999.

    Your last formula works and that is what exactly I'm looking for.

    I do appreciate the effort and knowledge you are sharing.

  20. #20
    Forum Contributor
    Join Date
    07-28-2015
    Location
    london
    MS-Off Ver
    Microsoft Office 365
    Posts
    113

    Re: Exclude Holidays in Total

    Hi,

    Apologies again for re-opening this thread as I come across with a new error.

    The weekend seems to identify the New Year if falls on a Weekend, but When I changed the date and looked into December, the Christmas Holiday that falls on Weekend (01/12/202 Sunday) was subtracting from the weekend. So then I'm getting a negative 1 instead of zero result.

    My goal here is any holiday that falls on a weekend should only be calculated under the Holiday column, if it falls on a weekend then it should not be calculated as part of weekend, if the rest of the month has the weekend filled, then it should only count the weekends excluding holiday.

    From the attached file sample I have above, The January 1st that falls on a weekend seems to work but not with other holidays like Christmas that falls on a weekend.

    Any light on this is greatly appreciated.

    Thank you in advance.

  21. #21
    Forum Contributor
    Join Date
    07-28-2015
    Location
    london
    MS-Off Ver
    Microsoft Office 365
    Posts
    113

    Re: Exclude Holidays in Total

    Hi,

    Any suggestion please?

    I just don't know the formula to make it work.

    I appreciate your help in advance.

    Thank you..

  22. #22
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,570

    Re: Exclude Holidays in Total

    Perhaps changing the weekend formula in cell AM4 (Jan sheet) as follows will help:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    If not, please upload a sample file illustrating the issue and providing the expected result.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  23. #23
    Forum Contributor
    Join Date
    07-28-2015
    Location
    london
    MS-Off Ver
    Microsoft Office 365
    Posts
    113

    Re: Exclude Holidays in Total

    Hi,

    Thanks for the suggestion. I think I got where the problem is coming from. All of the solutions above works anyway.

    Thank you.

  24. #24
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,570

    Re: Exclude Holidays in Total

    Thank You for the feedback and for marking the thread as 'Solved'. I hope that you have a blessed 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. [SOLVED] Exclude Holidays from two different times
    By Framboosje in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-25-2018, 05:27 AM
  2. Exclude Weekends and holidays
    By biznez in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-30-2015, 02:38 PM
  3. [SOLVED] Exclude holidays from list but NOT weekends
    By CClio333 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-17-2014, 12:18 PM
  4. Reference previous weekday to exclude holidays
    By Jogier505 in forum Excel General
    Replies: 5
    Last Post: 01-18-2010, 02:15 PM
  5. Exclude weekends and holidays from a formula.
    By Stevey in forum Excel General
    Replies: 5
    Last Post: 08-28-2009, 06:55 PM
  6. [SOLVED] Use networkdays INCLUDE weekends, Exclude holidays
    By ronnomad in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-16-2005, 01:00 PM
  7. Schedule to exclude weekends and holidays
    By Erin D. in forum Excel General
    Replies: 3
    Last Post: 03-15-2005, 06:06 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