<-- Previous || Up || Next -->

Days 360 Test Sub
Math Financial Class

Public Sub Days360Test()
    'Compare the Excel version of the Days360 function to the Excel's Days360 function.

    Const datBeg = #1/1/1991#
    Const datEnd = #1/1/1998#

    Dim datFm As Date, datTo As Date, intMethod%, lngXL&, lngES&

    For datFm = datBeg To datEnd
        DoEvents
        If Day(datFm) = 5 Then datFm = datFm + 20
        If Day(datFm) = 1 Then Debug.Print Now, datFm

        For datTo = datBeg To datEnd
            If Day(datTo) = 5 Then datTo = datTo + 20

            For intMethod = -1 To 0
                lngXL = WorksheetFunction.Days360(datFm, datTo, intMethod)
                lngES = Days360(datFm, datTo, intMethod, True)

                If lngXL <> lngES Then
                    Debug.Print datFm, datTo, intMethod, lngXL, lngES, lngES - lngXL
                End If
            Next intMethod
        Next datTo
    Next datFm
End Sub

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.