UTexas80 Posted August 12, 2008 Posted August 12, 2008 Does anyone have a suggestion concerning how I can calculate the date of the 3rd Friday for a month. Thank you.
Quartekoen Posted August 12, 2008 Posted August 12, 2008 (edited) 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 August 12, 2008 by Guest Added Example File
LaRetta Posted August 12, 2008 Posted August 12, 2008 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 )
UTexas80 Posted August 12, 2008 Author Posted August 12, 2008 Y'all are great!!! Thank you for the quick response. I appreciate it very much.
JustJoker Posted January 23, 2011 Posted January 23, 2011 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?
comment Posted January 23, 2011 Posted January 23, 2011 Try = Let ( [ d = date - Day ( date ) + 1 ] ; d + Mod ( 6 - DayofWeek ( d ) ; 7 ) + 14 )
Recommended Posts
This topic is 5052 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 accountSign in
Already have an account? Sign in here.
Sign In Now