Extracting Weekdays from a Date (WEEKDAY)

Syntax: WEEKDAY(t; Day)

The WEEKDAY function is used to convert a date given in any recognizable format into a day of the week. Days are numbered from 0 (Sunday) to 6 (Saturday). For example:

=WEEKDAY("1/1/2010")

returns 6.

images

Figure 12-6. Sample result of the WEEKDAY function

This result is produced by WEEKDAY assuming that weeks start on Sunday (day 0).

You can modify those results with the day argument. Its values can be as follows:

  • 1: week starts on Sunday (day 0).
  • 2: weeks start on Monday (day 1).
  • 3: weeks start on Monday (day 0).

Compare the following formulas and their results for the same ...

Get Beginning OpenOffice Calc: From Setting Up Simple Spreadsheets to Business Forecasting now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.