LOOSE DOCUMENTATION FOR CALENDAR

***Data as of: February 4th, 2001 


CALENDAR is a "program" written in Excel so one can input a year and Excel will ouput all the days of the year in a calendar format. All you have to do is input your desired year into cell 'H1' of the spreadsheet and execute. 

This app's basically done, except when printing; please only print the first page. By making the 
print area 1xx% of the original size, u can make the calendar "bigger" when printed out. Do this if you want the whole page to be used up.

Hopefully, when I have more time to burn, Cal v2.0 will improve this app cosmetically and make
some parts of the code execute more efficiently. For example; due to the fact that Excel is not the best tool to write such a program in and the limitations of itself and my coding abilities, one may notice the extra rows at the end of each month. 

Requests to make modifications so that months can be printed out on single pages have been answered w/the latest version of Calendar. I've even included views of the preceeding and following months located at the top portion of each month for easier reference. 


***Minimum Requirements:
Microsoft Excel 2000  (I have not verified if Calendar is backward compatible for other versions of Excel, though it should be)
Printer  (unless u just wanna use it on the screen, but this was created to help in tracking/predicting and making appointments) Yes, WINs, we can finally pick the days of the week for our bi-weekly BBQ =)

***Limitations: 
While the "Centesimal Leap Year" feature works, there exists a "Problem2045", where Excel outputs wrong values for the calendar. This is when cell 'H1' is given a year more than or equal to 2045. For some reason not yet determined, Excel... or me for that matter... um, screwed up. Other than this, Calendar works fine. The bottom line is that the lower limit of cell 'H1' is 1901 and upper limit, 2045. The Centesimal Leap Year feature is derived from the fact that while leap years are years that can be wholly divided by four (4) and also one hundred (100); a year is NOT a leap year if if can be wholly divided by one hundred (100) UNLESS it is wholly divisible by four hundred (400). 
EX:  1992,1996,2000,2004,2008 and 1600 are leap years, but 1998,1999,1700,1800 and 1900 are not.

***Notes:
This file originally was called "ExcelCalFxTxt" during 
programming... 
Because of "Problem2045" and Lower/Upper limits, the CLP feature is in place but bound and not thoroughly exhibited. 

This program may be freely distributed as long as these three (3) files; the two Excel files and this readme, are intact: 
CalReadMe.txt
MonthCalendar.xls
YearCalendar.xls

Questions/comments/suggestions:
AIM: Aya16CE
E-mail:  Aya16D@aol.com

Original Files/Location:
C:\.....\NonSCHL\Cal10vi.xls   (split)
C:\.....\NonSCHL\ExcelCalFxTxt.txt
HD-C: "Falcon1"
Soon to be released on USB resnet network at Workgroup: "Dewey1"   Computer: "Falcon1"  and the Internet at my website;   "www.geocities.com/falcon741w"

Credits:
Dave Chang
Allen Chang

Thanx To:
The people of NYCHA for coming up with the original idea and visual template for Calendar 
Half-Life/Counterstrike for getting my brain juices flowing when I had programmer's block
WinAmp for all those joyous scripting hours
Burger King and Welch's 100% Grape Juice for the sustenance
Barbara, for playing the piano while I played my WinAmp
Jason and my bike, for the VB/C++ Development Suite CD 
MTC for MS Excel 2000
Tekken Tag Tournament for making me sick of it and working on this
WIN's Marskman Repeater for those holes in the walls everytime I got stuck
The "Save" in Excel
Cut-n-Paste





The block(s) below were crucial scripts and formulas during the making of Calendar, for open 
source reference:

V1.0----------------------------------------------------------------------------------------------------------

SUM(R[-1]C[6])+1     to make the week cycle over and add one
SUM((R[-1]C[6])+1)

SUM((R(C-1)+1)   make days counter, most likely wrong syntax
SUM(RC[]+1)
(RC[-1])+1           syntax should work. had to revert to A# form of relative reference

6+MOD(((H1-2000)+(QUOTIENT((H1-2000),4)),7)
MOD(((H1-2000)+(QUOTIENT(H1-2000,4))),7)

MOD((((H1-2000)+(TRUNC(H1-2000/4)))+6),7)     correct syntax for year adv
MOD((((2000-H1)+(TRUNC(2000-H1/4)))+6),7)     " " " " subtraction

IF((7-W1)<=0,"",7-W1)      mo.begincalc
IF((28-A4)>28,"",28-A4)     mo.endcalc

IF(OR(A4=0,A4=""),(A8=W6),A4=A4)    likely infinite loop on cellA6, detour?
IF(OR(A4=0,A4=""),(A4=W6),A4=A4)     still looped, A4 or A8 in Fx?

MOD((((H1-2000)+(TRUNC((H1-2000)/4)))+6),7)
6-(MOD(((2000-H1)+(TRUNC((2000-H1)/4))),7))     correct recent

IF((H1>2000),IF((1-W1)<=0,"",1-W1),IF((1-W2)<=0,"",1-W2)
IF((H1>2000),IF((1-W1)<=0,"",1-W1),IF((1-W2)<=0,"",1-W2))

IF(H1>=2000,(MOD((((H1-2000)+(TRUNC((H1-2000)/4)))+6),7)+1),MOD((((H1-2000)+(TRUNC((H1-2000)/4)))+6),7))             2nd most recent H1 cell Fx.

IF(AND(H1>=2000,H1<2004),(MOD((((H1-2000)+(TRUNC((H1-2000)/4)))+6),7)+1),MOD((((H1-2000)+(TRUNC((H1-2000)/4)))+6),7))              most recent H1 cell Fx. w/"2045" fix attempt... still exhibits "Problem2045" 

IF(OR(A4=0,A4=""),(A4=W6),A4=A4)       A4cellstuff, replaced w/  W6   ?

IF((28-G4)>28,"",28-G4)     A4 replaced w/G4 in Mo.EndCalc.; previous file is "gg", this is "h"

IF(G4=1,F8=28,IF(G4=2,F8=29,IF(G4=3,F8=30,IF(G4=4,F8=31,""))))       
IF(G4=1,F8=E38,IF(G4=2,F8=F39,IF(G4=3,F8=G38,IF(G4=4,F8=H38,""))))
IF(G4=1,E38,IF(G4=2,F39,IF(G4=3,G38,IF(G4=4,H38,""))))     <---NewFx.w/actualReturn!
IF(G4=1,E38,IF(G4=2,F39,IF(G4=3,G38,IF(G4=4,H38,IF(G4=5,I38,IF(G4=6,J38,IF(G4=7,K38,"")))))))                                                                             <--- fullFx.for28thCell
1stTheoryForMo.End

*** cellC9 used to be Fx.:  W22
*** "Problem2045" still exists up to save   cal9ii.xls
*** zeroes in end of mo. needs cosmetic improvement, january works as of save   cal9ii.xls
*** save    cal9iii.xls    fixed zeroes in end error
*** save    cal9iv.xls    fixed zeroes in end error 'completely'
*** save    cal9vii        working on EndMo.Calc... have to consider the year > V < 2000

IF((31-W1)>31,"",31-W1)      EndMo.Fx.
IF((H1>2000),IF((2-W1)<=0,"",2-W1),IF((2-W2)<=0,"",2-W2))
IF((H1>2000),IF((37-W1)>31,"",37-W1),IF((37-W2)>31,"",37-W2))       <---Eureka!

IF((H1>2000),MOD((W1+3),7),MOD((W2+3),7))   NextMo.FormulaForDayAdv.

MOD((H38+3),7)       

IF((H1>=2000),MOD((F38+F36),7),MOD((G38+G36),7))     MarchCalc.

 IF(N4=1,I37,IF(N4=2,J37,IF(N4=3,K37,IF(N4=4,L37,IF(N4=5,M37,IF(N4=6,N37,IF(N4=7,O37,"")))))))         cellH8dataprevious

IF(((MOD(H1,4))=0),1,0)       OriginalkLeapYearTestFx.

IF(AND(MOD(H1,4)=0,MOD(H1,400)=0),1,IF(AND(MOD(H1,4)=0,MOD(H1,100)=0)),0,IF(  AND(MOD(H1,4)=0,MOD(H1,100)<>0),            Revision1

=IF(AND(MOD(H1,4)=0,MOD(H1,400)=0,MOD(H1,100)=0),1,IF(AND(MOD(H1,4)=0,MOD(H1,100)<>0),1,IF(AND(MOD(H1,4)=0,MOD(H1,400)=0,MOD(H1,100)          Revision2

=IF(AND(MOD(H1,4)=0,MOD(H1,400)=0,MOD(H1,100)=0),1,IF(AND(MOD(H1,4)=0,MOD(H1,100)=0,MOD(H1,400)<>0,0,R11             ,IF(AND(MOD(H1,4)=0,MOD(H1,400)=0,MOD(H1,100)        Revision3; we're getting there dammit...

=IF(AND(MOD(H1,4)=0,MOD(H1,400)=0,MOD(H1,100)=0),1,IF(AND(MOD(H1,4)=0,MOD(H1,100)=0,MOD(H1,400)<>0)),1,IF(AND(MOD(H1,4)=0),1,0))       Revision4, almost

IF(AND(MOD(H1,4)=0,MOD(H1,400)=0,MOD(H1,100)=0),1,IF(AND(MOD(H1,4)=0,MOD(H1,100)=0,MOD(H1,400)<>0),0,IF(MOD(H1,4)=0,1,0)))                         Revision5, grrrrr.....

V1.3----------------------------------------------------------------------------------------------------------

IF((H1>2000),IF((1-W1)<=0,"",1-W1),IF((1-W2)<=0,"",1-W2))                  Jan.StartDayFx.

IF(AND(H1>=2000,H1<2004),(MOD((((H1-2000)+(TRUNC((H1-2000)/4)))+6),7)+1),MOD((((H1-2000)+(TRUNC((H1-2000)/4)))+6),7))                                   YearFxPrimary1

6-(MOD(((2000-H1)+(TRUNC((2000-H1)/4))),7))          YearFxPrimary2

IF(AND((H1+1)>=2000,(H1+1)<2004),(MOD(((((H1+1)-2000)+(TRUNC(((H1+1)-2000)/4)))+6),7)+1),MOD(((((H1+1)-2000)+(TRUNC(((H1+1)-2000)/4)))+6),7))      YearFxSecondary1

6-(MOD(((2000-(H1+1))+(TRUNC((2000-(H1+1))/4))),7))    YearFxSecondary2

IF((H1>2000),IF((1-W1)<=0,"",1-W1),IF((1-W2)<=0,"",1-W2))
IF((H1>2000),IF((2-W1)<=0,"",2-W1),IF((2-W2)<=0,"",2-W2))
IF((H1>2000),IF((3-W1)<=0,"",3-W1),IF((3-W2)<=0,"",3-W2))
IF((H1>2000),IF((4-W1)<=0,"",4-W1),IF((4-W2)<=0,"",4-W2))
IF((H1>2000),IF((5-W1)<=0,"",5-W1),IF((5-W2)<=0,"",5-W2))
IF((H1>2000),IF((6-W1)<=0,"",6-W1),IF((6-W2)<=0,"",6-W2))
IF((H1>2000),IF((7-W1)<=0,"",7-W1),IF((7-W2)<=0,"",7-W2))      OriginalJanuaryStartFxs.,priortoV1.3
!IN MODIFIED FXS. REPLACE ALL "W"s W/"Y"s AND ADD ONE (1) TO ALL "H"s!

IF((H1>2000),IF((28-W1)>31,"",28-W1),IF((28-W2)>31,"",28-W2))     
IF((H1>2000),IF((29-W1)>31,"",29-W1),IF((29-W2)>31,"",29-W2))
IF((H1>2000),IF((30-W1)>31,"",30-W1),IF((30-W2)>31,"",30-W2))
IF((H1>2000),IF((31-W1)>31,"",31-W1),IF((31-W2)>31,"",31-W2))
IF((H1>2000),IF((32-W1)>31,"",32-W1),IF((32-W2)>31,"",32-W2))
IF((H1>2000),IF((33-W1)>31,"",33-W1),IF((33-W2)>31,"",33-W2))
IF((H1>2000),IF((34-W1)>31,"",34-W1),IF((34-W2)>31,"",34-W2))
IF((H1>2000),IF((35-W1)>31,"",35-W1),IF((35-W2)>31,"",35-W2))
IF((H1>2000),IF((36-W1)>31,"",36-W1),IF((36-W2)>31,"",36-W2))
IF((H1>2000),IF((37-W1)>31,"",37-W1),IF((37-W2)>31,"",37-W2))   OriginalJanuaryEndFxs.priortoV1.3
!IN MODIFIED FXS. REPLACE ALL "W"s W/"Y"s AND ADD ONE (1) TO ALL "H"s!       

IF(E46=7,3,IF(E46=6,2,IF(E46=5,1,IF(E46=4,7,IF(E46=3,6,IF(E46=2,5,IF(E46=1,4,"")))))))
Fx.ForCalc.OfPriorYearDecember

--------------------------------------------------------------------------------------------------------------





END.











