Solved

Third Thursday of each month (use previous workday)

Posted on 2012-12-26
7
340 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
  • 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
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 Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

806 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