3

I am using MS Excel together with VBA (Visual Basic for applications) to write macros to calculate Molad Tishrei.

I have located information in various web sites that explain how to calculate Molad Toshrei for 1 year if I know the Molad of the previous year. However, I cannot use a fixed calculation for determining the Molad of a random year, since I don't know how many leap years occurred since that random year, and the result comes out incorrectly.

I found some web articles that explain the overall concepts, but I need a step by step algorithm or math formula that works. I.e. - if I know when Molad Toshrei for 5774 was, and I want to find out Molad Tishrei for 5790, how do I do that?

Ideally, if someone has written VB code or done this in Excel, that would be great. However, even if I have a "simplified" stepwise English-explained algorithm, that would work as well.

You don't have to answer with code, of course. A link would be fine. If you have tested the code yourself and verified that it works, even better!

4

Here's a detailed explanation, with pseudocode-like notation. http://individual.utoronto.ca/kalendis/hebrew/molad.htm#calc.

The following is my own summary:

MonthlyMoladDifference = 29 days + 12 hours + (44 + 1/18) minutes.

MoladTishrei5775 = [...]
NewMolad = MoladTishrei5775

for(year=5775; year<currentYear; year++) {
    IsLeapYear = [0, 3, 6, 8, 11, 14, 17] contains (year % 19)
    if(isLeapYear) then
        NewMolad += 13 * MonthlyMoladDifference
    else
        NewMolad += 12 * MonthlyMoladDifference
}
// NewMolad now contains the molad for Tishrei of the current year.

NewMolad += (months since Tishrei) * MonthlyMoladDifference
// NewMolad now contains the molad for the current month
  • Thanks. I translated the loop idea into VBA and it works great! – DanF Sep 14 '14 at 15:21
2

Copying Ypnypn's pseudocode and adjusting it so it can check all years and so it doesn't require a loop:

MonthlyMoladDifference := 36:44:03.33...
YearlyMoladDifference := MonthlyMoladDifference*12
CyclelyMoladDifference := YearlyMoladDifference*19 + MonthlyMoladDifference*7

Molad := 29:11:20 //comment: tohu (year 1)

input Year
Cycles = Year/19 //comment: integer division
Remainder = Year modulo 19 //comment: 0..18

Molad += Cycles*CyclelyMoladDifference
Molad += Remainder*YearlyMoladDifference
Molad += MonthlyMoladDifference* case Remainder
         when <3 then 0
         when <6 then 1
         when <8 then 2
         when <11 then 3
         when <14 then 4
         when <17 then 5
         else 6 end-case
print Year . " Tishrei molad is " .
      cast (Molad modulo 168:00:00 as day-of-week, hour:minute:second.decimal)
  • 1
    Thanks. I understood the psudocode and applied it to my VBA program, and it works great. Thanks for the efforts! – DanF Sep 14 '14 at 15:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .