******************** TSDATES Demo Add-In For Excel 4.0 ***************** Copyright 1992 - TouchSoft Libraries TouchSoft Libraries 10 Moonstone Byway, Unit 151 Willowdale, Ontario, Canada M2H 3J2 PH: (416) 756-9136 FAX: (416) 374-6270 To view this file properly in NOTEPAD, maximize the NOTEPAD window and turn on 'Word Wrap' ( select 'Edit' from the main menu and check 'Word Wrap' ). This demo add-in (TSDATESS.XLL) for Microsoft Excel v4.0 for Windows contains four TSDATES date functions that can be called as native Excel functions from your worksheets. These four functions will give you a flavour for the more than 60 functions contained in the full TSDATES library. If you find these functions useful, you can order the full library from TouchSoft Libraries by printing the ORDER.DOC file, completing it and sending it to the above address along with your payment. We will send you a diskette containing the TSDATES.XLL add-in file, as well as a full reference manual in Microsoft Write format (WRI). The file LIBREF.WRI contains a summary of the date functions contained in the full TSDATES library. LIMITATIONS In no event will TouchSoft Libaries be liable for any damages, including loss of data, lost profits, or any other incidental or inconsequential damages arising from the use of this product. ACKNOWLEDGEMENTS Microsoft is a registered trademark of Microsoft Corporation, and Windows is a trademark of Microsoft Corporation. INSTALLATION To install the TSDATES demo add-in, follow these steps. In Excel, choose File Open to get to the File Open dialog box. Choose the drive in which you have placed the TSDATES demo diskette, then highlight the file TSDATESS.XLL and press Open. The TSDATES demo library functions will then be available for use in your worksheets during the current Excel session. The next time you start Excel, TSDATES will not be available until you again open the TSDATESS.XLL file. Note that TSDATES can also be installed 'permanently' by using Excel's Add-In Manager, or by placing the TSDATESS.XLL file in Excel's startup directory (default is \EXCEL\XLSTART ). FUNCTION REFERENCE Listed below is the documentation for the four TSDATES functions included in this demo version of the TSDATES library (tsADDM, tsLQP, tsNETQ, tsRWDSINM). **** tsADDM(BaseDate,#Months,Refinement Criteria) **** BaseDate is a datevalue in the range 1 (Jan 1, 1900) to 65,380 (Dec 31, 2078). #Months is an integer in the range -2136 to 2136. Refinement Criteria is an integer in the range 0 to 8. tsADDM calculates the date which is #Months months from BaseDate. Refinement Criteria is a parameter which specifies a fine tuning adjustment for the resulting date and is set as follows: Refinement Criteria Pneumonic Description 0 NOREF No adjustment to date. 1 FMFOC Adjust to first of month following or coincident with 2 FMF Adjust to first of month following 3 LMFOC Adjust to last of month following or coincident with 4 LMF Adjust to last of month following 5 FMPOC Adjust to first of month preceding or coincident with 6 FMP Adjust to first of month preceding 7 LMPOC Adjust to last of month preceding or coincident with 8 LMP Adjust to last of month preceding Examples: tsADDM( 01-Feb-92, 6, 1 ) = 01-Aug-92 tsADDM( 01-Feb-92, 6, 2 ) = 01-Sep-92 tsADDM( 29-Feb-92, 6, 0 ) = 31-Aug-92 In the absence of a Refinement Criteria fine tuning adjustment, the day of the month of the calculated datevalue is the same as the day of the month of BaseDate. Exceptions: If BaseDate is the last day of a month, then the day of the month of the calculated datevalue will be the last day of that month. Also, If the day of the month of BaseDate is greater than the number of days in the month of the calculated datevalue, then the calculated datevalue is the last day of the month. Examples: tsADDM( 31-Jan-92, 1, 0 ) = 29-Feb-92 tsADDM( 30-Jan-92, 1, 0 ) = 29-Feb-92 tsADDM( 29-Feb-92, 1, 0 ) = 31-Mar-92 tsADDM( 28-Feb-92, 1, 0 ) = 28-Mar-92 If any datevalue arguments are non-numeric, a #VALUE! error is returned. If a datevalue argument is numeric, but is not a valid Excel datevalue, a #NUM! error is returned. If any of the arguments to a TSDATES function evaluate to an Excel error value, the same error value is returned by this function. **** tsLQP(BaseDate) **** BaseDate is a datevalue in the range 1 (Jan 1, 1900) to 65,380 (Dec 31, 2078). tsLQP returns the date which is the last day of the quarter preceding 'Date'. Examples: tsLQP( 01-Sep-92 ) = 30-Jun-92 tsLQP( 30-Jun-92 ) = 31-Mar-92 If any datevalue arguments are non-numeric, a #VALUE! error is returned. If a datevalue argument is numeric, but is not a valid Excel datevalue, a #NUM! error is returned. If any of the arguments to a TSDATES function evaluate to an Excel error value, the same error value is returned by this function. **** tsNETQ(StartDate, EndDate, Refinement Criteria) **** StartDate, EndDate are datevalues in the range 1(Jan 1,1900) to 65,380 (Dec 31,2078). Refinement Criteria is an integer in the range 0 to 2. tsNETQ calculates the number of quarters between StartDate and EndDate. Refinement Criteria is a parameter which specifies the fine tuning adjustment to the calculated interval and is set as follows: Refinement Criteria Pneumonic Description 0 CQ Count the number of completed quarters 1 CCQ Count the number of completed calendar quarters 2 PCQ Count the number of quarters, where any part of a calendar quarter counts as a full quarter Examples: tsNETQ( 15-Jan-92, 15-Oct-92, 0 ) = 3 tsNETQ( 15-Jan-92, 15-Oct-92, 1 ) = 2 tsNETQ( 15-Jan-92, 15-Oct-92, 2 ) = 3 Completed Quarters(CQ): Given a date, the date which is one completed quarter from that date has the same day of the month, but is 3 months later. If the day of the month is greater than the number of days in the month 3 months later, then from that day to the end of the month 3 months later is also a completed quarter. Examples: January 31, 1992 to April 30, 1992 is a completed quarter February 29, 1992 to May 29, 1992 is a completed quarter January 15, 1992 to April 15, 1992 is a completed quarter January 1, 1992 to March 31, 1992 is not a completed quarter Completed Calendar Quarters(CCQ): This is defined as the number of completed quarters from the first day of the quarter following or coincident with StartDate to the first day of the quarter preceding or coincident with EndDate. If any datevalue arguments are non-numeric, a #VALUE! error is returned. If a datevalue argument is numeric, but is not a valid Excel datevalue, a #NUM! error is returned. If any of the arguments to a TSDATES function evaluate to an Excel error value, the same error value is returned by this function. **** tsRWDSINM(BaseDate) **** BaseDate is a datevalue in the range 1 (Jan 1, 1900) to 65,380 (Dec 31, 2078). tsRWDSINM returns the number of weekdays from BaseDate to the end of the month containing BaseDate. Example: tsRWDSINM( 10-Sep-92 ) = 14 If any datevalue arguments are non-numeric, a #VALUE! error is returned. If a datevalue argument is numeric, but is not a valid Excel datevalue, a #NUM! error is returned. If any of the arguments to a TSDATES function evaluate to an Excel error value, the same error value is returned by this function.