===Phase of the Moon for given date=== Shows the Phase of the moon as an integer from 0 to 7. Inspired by the first algorithm on this [[http://www.voidware.com/moon_phase.htm|page]] (unable to find a credit - do you know different?) and first published on The Back Shed [[https://www.thebackshed.com/forum/forum_posts.asp?TID=10472&PN=1|here]]. Provide the day, month and year as separate integers. **Syntax**: =MoonPhase(dd,mm,yyyy) **Examples**: Print MoonPhase(1,1,2000) z=MoonPhase(24,12,2019) Function MoonPhase(d As Integer,m As Integer,y As Integer) As Integer 'calculates the moon phase (0-7), accurate to 1 segment. '0 => new moon, 4 => full moon, 7= last part of third quarter (before new) Local Float j If m<3 Then y=y-1:m=m+12 m=m+1 j=(((365.25*y)+(30.6*m)+d)-694039.09)/29.53 'total days divided by the moon cycle MoonPhase=Fix((j-Int(j))*8) Mod 7 End Function