COUPDAYBS(settlement, maturity, frequency, [basis])
=COUPDAYBS(DATE(2019,2,15),DATE(2024,1,1),2,0)
This example uses the COUPDAYBS function to calculate the days from the coupon period to the settlement date using hardcoded arguments. The first argument is the start date of the coupon period (February 15, 2019), the second argument is the end date of the coupon period (January 1, 2024), the third argument is the frequency of coupon payments (2, meaning twice a year), and the fourth argument is the number of days from the settlement date to the next coupon payment (0, meaning the coupon payment is on the settlement date).
=COUPDAYBS(C6,C7,C10,C11)
This example uses the COUPDAYBS function to calculate the days from the coupon period to the settlement date for the values in C6, C7, C10, and C11. The first argument (C6) is the start date of the coupon period, the second argument (C7) is the end date of the coupon period, the third argument (C10) is the frequency of coupon payments, and the fourth argument (C11) is the number of days from the settlement date to the next coupon payment.
COUPDAYBS is a financial function which calculates the number of days from the start date of a coupon to its settlement date, using the US 30-day method and a 360-day year. It defaults to zero if omitted.