Its always surprising how a simply solution suddenly gets complicated! My
understanding of the concept of a 360 day year is that the year comprises 12
months of 30 days. If the month has either 31 days or 28/29 days in February,
then its assumed it has 30. I hadn't considered this when I responded. So, to
accomodate try:
Function Date360(FirstDate, SecondDate) As Integer
Dim FirstDay, SecondDay
Select Case Day(FirstDate)
Case 31
FirstDay = 30
Case 28, 29
If Month(FirstDate) = 2 Then
FirstDay = 30
Else
FirstDay = Day(FirstDate)
End If
Case Else
FirstDay = Day(FirstDate)
End Select
Select Case Day(SecondDate)
Case 31
SecondDay = 30
Case 28, 29
If Month(SecondDate) = 2 Then SecondDay = 30
Case Else
SecondDay = Day(SecondDate)
End Select
Date360 = ((DateDiff("m", FirstDate, SecondDate) - 1) * 30) + (30 -
FirstDay) + SecondDay
End Function
Try it and let me know if it still gives any incorrect answers so we can
adjust.
Cherers.
BW