'$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
Function easter(jahr As Variant) As Date
'$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
' calculates the date of western-christian easter
' = 1st sunday after 1st spring-full moon
' from Gauss ( the famous one )
' Source : MEYERS RECHENDUDEN,
' © Bibliographisches Institut Mannheim 1964, P.327 ff
' works correct from 1900 bis 2099
' function first published by mikelbower in Chip 7/97
Dim A, B, C, D, E, J, M, N, O, monat As Integer
' Date ?
If IsDate(jahr) = True Then
J = Int(Year(jahr))
' Year
ElseIf IsNumeric(jahr) Then
J = Int(jahr)
Else
Exit Function
End If
' is correct ?
if J < 1900 Or J> 2078 Then
Exit Function
End If
'Gauß' Formula
'for more currency use for M and N
'from 1700 - 1799 23 and 3
'from 1800 - 1899 23 and 4
'from 1900 - 2099 24 and 5
'from 2100 - 2199 24 and 6
'Gauß - Formula
'um eine weitere Gültigkeit zu erreichen setzen Sie für M und N
'von 1700 - 1799 23 und 3
'von 1800 - 1899 23 und 4
'von 1900 - 2099 24 und 5
'von 2100 - 2199 24 und 6
M = 24
N = 5
A = J Mod 19
B = J Mod 4
C = J Mod 7
D = (19 * A + M) Mod 30
E = ((2 * B) + (4 * C) + (6 * D) + N) Mod 7
O = 22 + D + E
If O > 31 Then
O = D + E - 9
monat = 4
If O = 26 Then O = 19
If O = 25 And D = 28 And (J Mod 19) > 10 Then O = 18
Else
monat = 3
End If
easter = DateSerial(J, monat, O)
End Function
1900> 1900> 1900>