• This service has been inactive since 2010 as my new role in TM1 consulting.
  • Please disregard any commercial offers as this website has been archived and transformed into a blog rather than a commercial website.
  • Please contact me for more info in BI and Financial Modelling consultancy.

Next coupon date - IF THEN formula

This was actually a simple problem in semi-annual coupon bond pricing when I was asked to determine the next coupon/interest date after the settlement date. I just needed to use my common sense to find the date from the maturity date.



If the maturity date is 15-Jul-08 and the coupon is paid semi-annually, then the coupon dates are 15-Jan and 15-Jul (6 month difference) ignoring the year. If the settlement date is 16-Oct-07, then the next date after 16-Oct-07 between 15-Jul and 15-Jan should be 15-Jan-08. It's easy!

However, Excel and Visual Basic never consider my common sense to work just like that. There is always a formula or function need to be developed. Surprisingly, using the arithmetical date formula, I came up with the longest if then formula I've ever made. That's crazy as I couldn't find the simpler one.

Finally, I found this bloody Excel formula:
=IF(AND(B3>DATE(YEAR(B3),MONTH(F3)+6,DAY(F3)),DATE(YEAR(B3),MONTH
(F3)+6,DAY(F3))>DATE(YEAR(B3),MONTH(F3),DAY(F3))),DATE(YEAR(B3)+1,
MONTH(F3),DAY(F3)),IF(AND(B3DATE(YEAR(B3),MONTH(F3),DAY(F3))DATE(YEAR(B3),MONTH(F3),DAY(F3)),DATE(YEAR(B3),MONTH(F3)+6,DAY(F3))))

And this is the easy way of how you look at the formula:
IF(
AND(B3>DATE(YEAR(B3),MONTH(F3)+6,DAY(F3)),
DATE(YEAR(B3),MONTH(F3)+6,DAY(F3))>DATE(YEAR(B3),MONTH(F3),DAY(F3))),

=> if Settlement Date > first Coupon Date > second Coupon Date

DATE(YEAR(B3)+1,MONTH(F3),DAY(F3)),
=> next coupon date

IF(
AND(B3DATE(YEAR(B3),MONTH(F3),DAY(F3))
=> if Settlement Date < first Coupon Date < second Coupon Date

DATE(YEAR(B3),MONTH(F3),DAY(F3)),
=> next coupon date

Else,
=> if first Coupon Date < Settlement Date < second Coupon Date

DATE(YEAR(B3),MONTH(F3)+6,DAY(F3))))
=> next coupon date


Bear in mind that 15-Jul-07 is the first coupon date and 15-Jan-08 is the second coupon date and the settlement date 16-Oct-07 is between both dates, therefore the next coupon date is DATE(YEAR(B3),MONTH(F3)+6,DAY(F3)), which is on 15-Jan-08.

If you want to be spoiled by Excel, there is actually a formula already provided: COUPNCD(settlement,maturity,frequency,basis).
I just wanted to be a dumb person who had been trying to figure out this IF THEN formula.

CAPM return and cumulative data matter

This story began when I wrote about benchmark issue in CAPM. Then, it continued with an Excel model for optimisation of shares or funds portfolio. The main problem defined in the model is to select shares and find the optimised asset allocation in a portfolio with three scenarios:

1. Assumed CAPM can't be applied and historical data is important therefore historical mean (average) return and standard deviation are used to simulate random return normal distribution and calculate Variance Covariance matrix.

2. Assumed CAPM can't be applied and cumulative data is important therefore projected mean (average) return and standard deviation are used to simulate random return normal distribution and calculate Variance Covariance matrix.

3. Assume CAPM can be applied and cumulative data is important therefore projected CAPM return and standard deviation are used to simulate random return normal distribution and calculate Variance Covariance matrix.

Starting by processing 13 NZ shares in the optimisation model with the three scenarios then applying the result of the share selection and the asset allocation into three passive portofolios, after one month holding period I found the return as follows:

Scenario 1 = -8.98%



Scenario 2 = -2.86%



Scenario 3 = +6.06%



I will update after 12 months.