3rd Friday of month Excluding Holidays

talt0612

New Member
Joined
Nov 22, 2011
Messages
35
Hi all- i'm stuck on a problem: I need to calculate the 3rd friday of a given month, but if that date is a holiday (based on an array of predefined holiday dates), then I need to return the previous good workday (i.e. if Friday & Thurs are both holidays, return Wed.).

I can calculate the Third friday using the following:

A1: random date
B1: =MONTH(A1)&"/"&YEAR(A1)
C1: =B1+MOD(6-WEEKDAY(B1),7)+14

What I don't know how to do is say "if C1 matches any of the dates in the defined range "HolidayCalendar" then workday(c1,-1,HolidayCalendar)"

I'm using excel 2007 and an answer in excel or VBA is fine.

Thanks in advance for all your help.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hi all- i'm stuck on a problem: I need to calculate the 3rd friday of a given month, but if that date is a holiday (based on an array of predefined holiday dates), then I need to return the previous good workday (i.e. if Friday & Thurs are both holidays, return Wed.).

I can calculate the Third friday using the following:

A1: random date
B1: =MONTH(A1)&"/"&YEAR(A1)
C1: =B1+MOD(6-WEEKDAY(B1),7)+14

What I don't know how to do is say "if C1 matches any of the dates in the defined range "HolidayCalendar" then workday(c1,-1,HolidayCalendar)"

I'm using excel 2007 and an answer in excel or VBA is fine.

Thanks in advance for all your help.

You just about wrote the solution.
=WORKDAY(C1+1,-1,HolidayCalendar)
where HolidayCalendar is the named range of holidays.
NOTE: You will need the analyst toolpack add-in enabled to use the WORKDAY function.
 
Upvote 0

Forum statistics

Threads
1,226,730
Messages
6,192,703
Members
453,748
Latest member
akhtarf3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top