Here's a generic version of the first formula
=A1-DAY(A1)+1+n*7-WEEKDAY(A1-DAY(A1)+8-xday)
where n would be the instance number and xday the day (1=Sun through to 7=Sat) so 3rd Tuesday would be
=A1-DAY(A1)+1+3*7-WEEKDAY(A1-DAY(A1)+8-3)
Then the second formula can be amended based on the instance number only, generic version is
=A2+35-(ABS(DAY(A2+35)-n*7+3)>3)*7
n should be 1 to 4 only (if you use 5 then the first formula will give 5th instance if the month if there is one, but 1st instance of the next month if there isn't - 2nd formula won't work)