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

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
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,215,432
Messages
6,124,860
Members
449,194
Latest member
HellScout

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