Solved

Third Thursday of each month (use previous workday)

Posted on 2012-12-26
7
342 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

756 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