Introduction
Sometimes you want to know what the day of the week is, such as the 4th day of the month. You can use a Salesforce Formula for this.
Configuration
Create a formula that looks like this:
DATE(YEAR(TODAY()), MONTH(TODAY())+1, 1) + Day_of_Week__c - MOD( DATE(YEAR(TODAY()), MONTH(TODAY())+1, 1) - DATE( 1900, 1, 7 ), 7 ) + IF( MOD(DATE(YEAR(TODAY()),MONTH(TODAY())+1,1)-DATE(1900,1,7),7) >= Day_of_Week__c , 7, 0 ) + ( Occurrence__c - 1) * 7
Where Date_of_Week__c is the date of the week from 1 to 7 (e.g. 1 = Monday, 5 = Friday) and Occurrence is the number from 1 to 4 (e.g. 1 = First, 2 = Second.)
Testing
If you wanted to find the 4th Friday, you would set Day_of_Week to 5 and Occurrence to 4, and the output will be shown in your formula.