This information was provided by Claris Corporation on 16 March 1998, and incorporated into Apple Computer's Tech Info Library.
number 7 in cell A2.
3. To return a weekday number that begins with Sunday as day 1 and ends with Saturday
as day 7, use the following:
=WEEKDAY(A1)
The entry of 1/14/96 in cell A1 returns the number 1
in cell A2.
4. If you want the weekday number to be returned with Sunday beginning as day 0 and
ending with Saturday as day 6, the following will apply:
=WEEKDAY(A1)-1
Cell A1 with the entry of 1/14/96 returns the number 0 in cell A2.
Database
The calculations are slightly different than those in a spreadsheet or a table. Define the fields as follows, (assuming that "datefield' is where the date is entered and "weekname' or whatever you choose as a name will have these calculation(s) defined):
1. To return the day's name, use the following calculation:
DAYNAME(WEEKDAY('datefield'))
The "datefield' entry of 1/14/96 will return "Sunday" in the Ôweekname' field.
2. To return the weekday number that the date represents, use the following for a week
that begins with Monday as day 1 and ends with Sunday as day 7:
IF(WEEKDAY('datefield')=1, 7, WEEKDAY('datefield')-1)
The "datefield" entry of 1/14/96 will return the
number 7.
3. To return a weekday number that begins with Sunday as day 1 and ends with Saturday
as day 7 use the following:
WEEKDAY('datefield')
The "datefield" entry of 1/14/96 will return the
number 1.
4. If you want the weekday number to be returned with Sunday beginning as day 0 and
Saturday as day 6, the following will apply:
WEEKDAY('datefield')-1
The "datefield" entry of 1/14/96 will return the
number 0.
Note: In FileMaker Pro there is a calculation function called DAYNAME (date field) that does return the values Monday through Friday in a single step.