+ Reply to Thread
Results 1 to 11 of 11

Long Weekend Formula for Holiday

  1. #1
    Forum Contributor
    Join Date
    07-04-2013
    Location
    United States
    MS-Off Ver
    Excel for Mac -V 16.33 -- Office 365
    Posts
    279

    Long Weekend Formula for Holiday

    I am trying to calcuate which days are long holidays in a specific month. I was able to determine the holidays, and even have a formula I found online for calcualting the "Long Holiday" for the New Years, but can't figure out how to do it for other days in the month. To be clear, I am looking to input a specific month in one field, and then return the name of the holiday(s) that occur in that month/year. I then will add up the total number of holidays in that month. See attached.
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,893

    Re: Long Weekend Formula for Holiday

    Change the formula in E8 to =IF(OR(WEEKDAY(D8)=6,WEEKDAY(D8)=2),"Long weekend for ","No long weekend for ")&" "&$D$5 and copy it down.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    07-04-2013
    Location
    United States
    MS-Off Ver
    Excel for Mac -V 16.33 -- Office 365
    Posts
    279

    Re: Long Weekend Formula for Holiday

    Thank you for your formula. It worked like a Champ. The second part of my challenge is to be able to input any given month and have an adjacent field auto calculate the number of holidays in that month based on this formula. See attached updated file referenced as:
    Holiday Calcs v.2.
    Thanks in advance!
    Attached Files Attached Files

  4. #4
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Long Weekend Formula for Holiday

    e21=SUMPRODUCT(--(TEXT(D$8:D$18,"mmmyy")=TEXT(D21,"mmmyy")))
    Try this and copy towards down
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  5. #5
    Forum Contributor
    Join Date
    07-04-2013
    Location
    United States
    MS-Off Ver
    Excel for Mac -V 16.33 -- Office 365
    Posts
    279

    Re: Long Weekend Formula for Holiday

    This works great. The only problem is I need to manually change the date in cell D5 if the Month I am inputting falls on a different year. To further clarify, I am working on a project that needs to show what the number of holidays there are for 3 consecutive months. These months could fall within 2 separate years (i.e. December 2014, January 2015 and February 2015. Ideally I would like to input a month and have it auto calculate the number of holidays in that month. Is there a way to do this so I do not have to manually change cell D5?

    By the way, I did find a pretty nice website that does what I am looking for, but I need to incorporate the results in my excel file, hence I prefer to build the formula.

    http://www.timeanddate.com/date/workdays.html

    Thanks
    Last edited by Perk1961; 07-27-2015 at 01:10 AM.

  6. #6
    Forum Contributor
    Join Date
    07-04-2013
    Location
    United States
    MS-Off Ver
    Excel for Mac -V 16.33 -- Office 365
    Posts
    279

    Re: Long Weekend Formula for Holiday

    By the way, I did find a pretty nice website that does what I am looking for, but I need to incorporate the results in my excel file, hence I prefer to build the formula.

    http://www.timeanddate.com/date/workdays.html

    Thanks

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,060

    Re: Long Weekend Formula for Holiday

    Is this what you meant?
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  8. #8
    Forum Contributor
    Join Date
    07-04-2013
    Location
    United States
    MS-Off Ver
    Excel for Mac -V 16.33 -- Office 365
    Posts
    279

    Re: Long Weekend Formula for Holiday

    Almost!! The issue I am having is that the project I am working on requires 3 unique fields based off of 3 unique Months. As such, while the new formula works perfectly for a single month, the moment I add that formula into a field with a different year it gives an incorrect answer. See attached to see what I mean. I am not sure how to get around it, short of adding a larger database table reference that is more inclusive of a greater date range.
    Attached Files Attached Files

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,060

    Re: Long Weekend Formula for Holiday

    Certainly D7 to D17 can't be valid for two years at the same time!! I can't think of a sensible way forward; other than to extend your database.

  10. #10
    Forum Contributor
    Join Date
    07-04-2013
    Location
    United States
    MS-Off Ver
    Excel for Mac -V 16.33 -- Office 365
    Posts
    279

    Re: Long Weekend Formula for Holiday

    Thank you for all your effort. It really helped. I agree that the only solution is likely to extend the data base.

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,060

    Re: Long Weekend Formula for Holiday

    Glad to have helped! If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. It'd also be appreciated if you were to click the add Reputation button at the foot of any of the posts of those who helped you reach a solution.

+ 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. Weekend and Holiday analysis with Time
    By leenie in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-27-2014, 12:46 PM
  2. [SOLVED] IF function using WORKDAYS and a Bank Holiday list - trying to add new holiday dates
    By jowarks in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-05-2013, 05:42 AM
  3. Replies: 3
    Last Post: 11-15-2012, 07:55 PM
  4. [SOLVED] Determine last date of attendance as we considered weekend, public holiday and absent date
    By ashburnadam in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-21-2012, 12:08 AM
  5. [SOLVED] Sum Weekend and Holiday Values Based on a Date Range in another Cell
    By GiGi320 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-27-2012, 11:53 AM
  6. how to sum day if it falls in a weekend or holiday?
    By jgomez in forum Access Tables & Databases
    Replies: 2
    Last Post: 11-30-2011, 01:54 PM
  7. filter out weekend\holiday days from a pivot table
    By nmss18 in forum Excel General
    Replies: 3
    Last Post: 06-01-2011, 03:10 PM
  8. Time difference - without weekend/holiday
    By blizard in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-08-2005, 03:14 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