A formula to calculate 2nd Wednesday of month from any date (DOM) of this month:
Code:
=DATE(YEAR(DOM);MONTH(DOM),1) + (2-1)*7 + (WEEKDAY(DATE(YEAR(DOM),MONTH(DOM),2))<3)*(3-WEEKDAY(DATE(YEAR(DOM),MONTH(DOM),2))) + (WEEKDAY(DATE(YEAR(DOM),MONTH(DOM),2))>3)*(7+3-WEEKDAY(DATE(YEAR(DOM),MONTH(DOM),2)))
I have used WEEKDAY() with 2 as 2nd parameter (weekdays are numbered from Monday to Sunday - i.e. European week definition);
In ...WEEKDAY(...,2)<3... and ...WEEKDAY(...,2)>3... the number 3 represents weekday number the returned date must have - for Wednesday it is 3;
In ...(2-1)*7... the number 2 represents the number of occurrence of asked weekday in this month.