Calculating Easter

Lewiy

Well-known Member
Joined
Jan 5, 2007
Messages
4,284
I have come across this code for calculating the date of Easter on Chip Pearson's site: http://www.cpearson.com/excel/holidays.htm

Code:
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

The definition of the date for Easter is "The first Sunday after the first full moon on or after the vernal equinox".

Does anyone know how/why the above code works (cos it does!) and how on earth Excel can possibly know the phases of the moon!! This has been puzzling me for some time now.
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Not a clue, but I found this as well...

Assuming the year is in A1,

Code:
=FLOOR(DAY(MINUTE(A1/38)/2+56)&"/5/"&A1,7)-34

I also saw one based on latitude and longitude 8-) which I can't locate at the moment.

Denis
 
Upvote 0
Thanks for that Andrew!

I did some digging through the Chip Pearson function. Easter Sunday is 1 March, offset by a calculation based on d.

d returns a sequence of 19 dates varying between 23 March and 20 April, if you convert the integer value for d to a day of the year.

I haven't looked in detail at the actual EasterSunday calculation yet...

Denis
 
Upvote 0

Forum statistics

Threads
1,225,327
Messages
6,184,301
Members
453,227
Latest member
Slainte

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top