Easter date macro

G

Guest

Hi,
Could someone please let me know why the following macro stopped working? IT
did replace my computer!

This macro used to work:

Public Function EasterDate(Yr As Integer) As Date

Dim d As Integer
d = (((255 - 11 * (Yr Mod 19)) - 21) Mod 30) + 21
EasterDate = DateSerial(Yr, 3, 1) + d + (d > 48) + 6 - ((Yr + Yr \ 4 + _
d + (d > 48) + 1) Mod 7)

End Function
 
P

Peo Sjoblom

It's a user defined function, you need to "install " it


http://www.mvps.org/dmcritchie/excel/install.htm




Or you can use built in functions


=DOLLAR(("4/"&A1)/7+MOD(19*MOD(A1,19)-7,30)*14%,)*7-6

won't work if you are using 1904 date system (default in Mac)


=DATE(A1,3,29.56+0.979*MOD(204-11*MOD(A1,19),30)-
WEEKDAY(DATE(A1,3,28.56+0.979*MOD(204-11*MOD(A1,19),30))))


will work under all date systems


for both formulas put the year in A1 and you will get the Easter date



--


Regards,


Peo Sjoblom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top