This seems so simple, but I'm having a mental block. Given, Maturity Date, Purchase Date, and Period, what would be a good function or formula to return the number of payments in a specified year.
e.g. A CD with a maturity of 2/5/25, purchase/settlement date of 3/4/24, and monthly payments would have 2 payments/coupons in 2025 (maturity and 1/5/2025) and 10 payments in 2024. If the Period was semi-annual, you'd have one payment in 2025 (at maturity) and one payment in 2024 (8/5/24). If it was a zero-coupon, you'd have one payment at maturity in 2025 and zero payments in 2024.
e.g. A CD with a maturity of 2/5/25, purchase/settlement date of 3/4/24, and monthly payments would have 2 payments/coupons in 2025 (maturity and 1/5/2025) and 10 payments in 2024. If the Period was semi-annual, you'd have one payment in 2025 (at maturity) and one payment in 2024 (8/5/24). If it was a zero-coupon, you'd have one payment at maturity in 2025 and zero payments in 2024.