Solved

Third Thursday of each month (use previous workday)

Posted on 2012-12-26
7
346 Views
Last Modified: 2012-12-27
Hello,

I am asking a follow up of :
http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Excel/Q_27977825.html

In that question, I have an answer to exclude holidays.
I now need to use the 3rd thursday of each month but if that 3rd thursday is a holiday from the excel tab named "Holiday" then use the preceding workday.

thank you

I think I basically need to combine these two formulae somehow:
this accounts for the holidays:
=WORKDAY(D1,1,Holidays!$H2:$H10)

this finds the third thursday of the month:
=CEILING(EOMONTH(A1,0)+1-DAY(EOMONTH(A1,0)+1)+1-5,7)+19

see attached file
workdayswithHolidays.xlsx
0
Comment
Question by:pdvsa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 50

Accepted Solution

by:
barry houdini earned 500 total points
ID: 38721619
If you have the first date in A1 this formula will give 3rd Thursday for following month

=EOMONTH(A1,0)+22-WEEKDAY(EOMONTH(A1,0)+3)

to give the previous workday if that's a holiday change to

=WORKDAY(EOMONTH(A1,0)+23-WEEKDAY(EOMONTH(A1,0)+3),-1,Holidays!$H$2:$H$10)

where holidays are shown in the range Holidays!$H$2:$H$10

...so if the 3rd Thursday is a holiday that will give you the day before (unless that's a holiday too.....)

regards, barry
workdays2.xlsx
0
 

Author Comment

by:pdvsa
ID: 38721762
Barry,   Will test when get back to computer...

On other question, would it be advisable to make this applicable in any workbook?  Meaning if i dragged right in a wb then the dates would adjust accordingly?  I wonder if there would be a conflict when i did not want to take into account the holidays on the Holidays tab and to set equal to the 3rd thursday of month.    Wanted to hear what an expert would say... Thank you
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 38721785
I'm not really sure what you are asking there. The formula will work even if the holiday range is empty, so if you want a formula that will work with or without holidays you could simply use the last (longer) formula and just add holidays when you want.

regards, barry
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Closing Comment

by:pdvsa
ID: 38721851
that worked perfectly.  Thanks.  As far as my other question, no need in trying to explain by text.  Its not important.  thanks though....
0
 

Author Comment

by:pdvsa
ID: 38723868
Berry:  not sure if you are monitoring.  

There would not be any issue in using the formula in 2007 excel?  I am not certain of the source but I have 2 guesses:  it might have something to do with the formula.  

=WORKDAY(EOMONTH(A1,0)+23-WEEKDAY(EOMONTH(A1,0)+3),-1,Holidays!$H$2:$H$10)

or a separate tab I copied over from another file.  The data is linked.  

If you dont believe it is the formula then I think it must be the other tab I imported with the links.  

thanks.
0
 

Author Comment

by:pdvsa
ID: 38724050
nevermind...it is not the formula...
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 38724107
No - all those functions are standard in Excel 2007 - clearly A1 needs to be a date, as long as that is the case then the formula should work OK......

regards, barry
0

Featured Post

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This article describes a serious pitfall that can happen when deleting shapes using VBA.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question