Jump to content

3rd Friday of the Month


UTexas80

This topic is 4863 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Well, the 3rd friday will always land between the 15th and the 21st (inclusive). Now, you can calculate the correct date based on what day the first of the month is with this sort of scripting:


Date ( MonthNum; 21 - Mod(DayOfWeek( Date(MonthNum;1;2008)); 7); 2008)

Where MonthNum is a field with the number of the month you want in it. Check the attached file for an example.

test.zip

Edited by Guest
Added Example File
Link to comment
Share on other sites

  • 2 years later...

Well, here is another option which eliminates hard coding at all:

Let ( [

m = Month ( date ) ;

y = Year ( date ) ;

d = Date ( m ; 1 ; y )

] ;

d - Mod ( d ; 7 ) - 2 + 21

)

Something strange here.

It calculates fine except January 2011. When I put any date in January the formula tells that the 3rd Friday in January,11 is January, 14 2011. But it's the 2nd Friday.

Does somebody know why?

Link to comment
Share on other sites

This topic is 4863 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.