**There are 2 types of floating dates.**

=IF(MONTH(DATE(A1,A2,1))<>MONTH(IF(WEEKDAY(DATE(A1,A2,1)-(WEEKDAY(DATE(A1,A2,1))-A3))<WEEKDAY(DATE(A1,A2,1)),DATE(A1,A2,1)+(A3-WEEKDAY(DATE(A1,A2,1)))+7,DATE(A1,A2,1)-(WEEKDAY(DATE(A1,A2,1))-A3))),"",IF(WEEKDAY(DATE(A1,A2,1)-(WEEKDAY(DATE(A1,A2,1))-A3))<WEEKDAY(DATE(A1,A2,1)),DATE(A1,A2,1)+(A3-WEEKDAY(DATE(A1,A2,1)))+7,DATE(A1,A2,1)-(WEEKDAY(DATE(A1,A2,1))-A3)))

If you wanted the last weekday of a month, use this formula (This formula calculates as above except there are only

=IF(A2<>MONTH(DATE(A1,A2+1,0)-(WEEKDAY(DATE(A1,A2+1,0))-A3)),DATE(A1,A2+1,0)-(WEEKDAY(DATE(A1,A2+1,0))-A3)-7,DATE(A1,A2+1,0)-(WEEKDAY(DATE(A1,A2+1,0))-A3))

A shortened version of the above formula for the last weekday was kindly
suggested by Vicente Soler.

=DATE(A1,A2+1,0)-WEEKDAY(DATE(A1,A2+1,0))+A3+IF(WEEKDAY(DATE(A1,A2+1,0))<A3,-7,0)

Thanks Vicente!

© Copyright andrewsexceltips.net. All Rights Reserved.