Subject: [OASIS Issue Tracker] Commented: (OFFICE-2260) COUPDAYS - Issettlement date a red herring?
[ http://tools.oasis-open.org/issues/browse/OFFICE-2260?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16799#action_16799 ] Patrick Durusau commented on OFFICE-2260: ----------------------------------------- Andreas, on the issue of settlement data - note that in your illustration, *only* the basis changed, which I agree gives a different result, due to the way the days of the month are counted. But that is a change in basis, not settlement date. Yes? On my assumptions about "settlement" date. Err, where did I assume the settlement date was 1999;11;5? I started from the settlement date in the test case, 1997;11;9, counted in 6 month intervals following that date. I don' t doubt I may have done something wrong but so far I don't see it. Can you explain further? > COUPDAYS - Is settlement date a red herring? > -------------------------------------------- > > Key: OFFICE-2260 > URL: http://tools.oasis-open.org/issues/browse/OFFICE-2260 > Project: OASIS Open Document Format for Office Applications (OpenDocument) TC > Issue Type: Bug > Reporter: Patrick Durusau > > I have been puzzling over the difference between COUPDAYS and COUPDAYBS. > COUPDAYBS - Calculates the number of days between the beginning of athe coupon period that contains the settlement date and the settlement date. > COUPDAYS - Calculates the number of days in a coupon period that contains a settlement date. > The syntax is the same and to be honest it took a good deal of looking to uncover the answer (or what I suspect to be the answer). > COUPDAYBS - Calculates the start date of a coupon period (which is independent of the settlement and settlement date) and then determines the number of days from that date to the settlement date. > COUPDAYS - Calculates the number of days in a coupon period, a value that is determined by the basis but *not* by the settlement date. Settlement date is in fact irrelevant to the number of days in a coupon period. > If that is correct, then the syntax and description of COUPDAYS are incorrect and should be changed. > I would recast as follows: > COUPDAYBS - Calculates the number of days from the start of a coupon period and a settlement date. (Semantics: Day count is for the coupon period that contains the settlement date.) > COUPDAYS - Calculates the number of days in a coupon period. > But then I look at COUPDAYBS, test case 1, COUPDAYBS( DATE(1997;11;9); DATE(1999;11;15); 2 ) > OK, so each coupon period is 6 months (frequency of payment, 2), I assume the first coupon period starts on 1997;11;9, so the coupon periods are: > 1997;11;9 - 1998;5;9 > 1998;5;9 - 1998;11;9 > 1998;11;9 - 1999;5;9 > 1999;5;9 - 1999;11;9 > 1999;11;9 - 1999;11;15 > Which I make out to be 6 days. > oops! The correct answer according to test case is 174. > Well, I am almost certainly missing some assumption or semantic but that means the text is as well. (Does this depend upon coupon periods being based on "whole" months as calculated from the basis setting?) -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://tools.oasis-open.org/issues/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira