COUPDAYS function returns the number of days in the coupon period that contains settlement date.
=COUPDAYS(settlement, maturity, frequency, [basis])
settlement – The date at which the security is traded to a buyer.
maturity – The date of expiry of the security also called maturity date.
frequency – The frequency of coupon payments in a specific period.
[basis] – The optional argument which is used to specify day count basis to use:
|Basis||Day count basis|
|0 or omitted||US (NASD) 30/360|
Suppose, a security/ bond has a settlement date of June 30, 2017, and maturity date of Aug 15, 2019, with 6 payments per year. The formula will be: