I am struggling trying to calculate the last coupon date for bonds with only the following information. First Coupon Date MM/DD/YYYY, Reset Frequency 1,6,12, and Maturity Date. There variances between the first coupon and maturity dates as far as the months, and the last coupon can not be greater then the maturity. Below are some examples. I have tried using everything from even breaking down the cells by month, day and year with no success.

2023-04-04_10-43-25.png