On 28/02/2011 04:25, IVP wrote: >> Here's the problem, you're in the wrong millennium! year !=3D 10 ; year = =3D >> 2010 >> >> Now it will work out to 319. (N3 =3D 2) > I tried it that way first > > (1 + INT(2010 - (4 * (INT(2010/4) + 2)/3))) > > Working from inside out > > INT(2010/4) + 2 =3D 504 > > * 4 =3D 2016 > > /3 =3D 672 > > N3 =3D 1 + INT(2010 - 672) =3D 1339 > > If N1 =3D 336 and N2 =3D 1 > > N =3D 336 - (1 * 1339) + 15 - 30 =3D - 1005 > > ? (I think) > > Joe > Hi Joe, It does work with the full year, you just have to get the order of stuff=20 right. I tried it with your first example and got 319 - for N3: 1 + ((2010 - 4 * (floor(2010 / 4) + 2) / 3) =3D 1 + ((2010 - 4 * (502) + 2) / 3) =3D 1 + ((2010 - 2008 + 2) / 3) =3D 1 + (floor(4/3)) =3D 2 N =3D 336 - (1 * 2) + 15 - 30 =3D 319 There is an example here: http://williams.best.vwh.net/sunrise_sunset_example.htm --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .