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
Solved

Third Thursday of each month (use previous workday)

Posted on 2012-12-26
7
341 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

837 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