I created a date-based algorithm to determine the moon phase. It works for any given date using the modern Gregorian calendar. The only problem is deciding when the "grey area" of the waxing/waning half-moon periods end and begin. It works because the lunar cycle is approximately 29.5 days for a lunar month and January 1st, 1900, (the start date for most spreadsheet date functions) is a known New Moon (No Moon). Another consideration is that when looking at a lunar calendar the dates given are when the moon phase is at its peak.
Lunar phases - ASL Equivalent
New Moon (No Moon) - No Moon
First Quarter Moon (Waxing Moon) - Half Moon
Full Moon - Full Moon
Third Quarter Moon (Waning Moon) - Half Moon
For example: The lunar phases for January 1900 are New Moon (Jan 1st), First Quarter (Jan 7th), Full Moon (Jan 15th), Third Quarter (Jan 23), and New Moon (Jan 30th). This means that the moon is darkest (New Moon) on 1/1/1900, increasingly gets lighter (waxing) between 1/2/1900 until it is completely a Half Moon on 1/7/1900, then increasingly brightens until it reaches peak Full Moon on 1/15/1900, then increasingly darkens (waning) until it again reaches full Half Moon on 1/23/1900, and finally reaches complete darkness again on 1/30/1900. Thus, a lunar phase calendar shows the midpoints where the moon is at its peak in a particular phase and the days in between those midpoints (say, Jan 2nd or Jan 20th) will either be near the midpoint of the phase or increasingly towards the next phase in the cycle. Using my algorithm, January 1st thru 4th would fall into the New Moon phase, then the First Quarter Moon (Waxing Half Moon) falls between January 5th thru 11th, the Full Moon falls between January 12th thru 18th, the Third Quarter Moon (Waning Half Moon) is between January 19th thru 26th, and the next No Moon phase starts on January 27th and continues thru February 3rd 1900.
I've compared my algorithm with online lunar phase calculators and I've yet to find any significant variations in it. It is entirely date based and works for any date past or present that uses the Gregorian calendar. Working backwards from January 1st, 1900, the lunar phases for December 1899 are No Moon (12/28-31), Waning Half Moon (12/21-27), Full Moon (12/14-20), Waxing Half Moon (12/6-13), and No Moon (11/29-12/5).
Here's a link to a visual lunar calendar:
Moon Phases Calendar for the month of May 2025