DAYOFWEEK Function (LibreOffice Calc)
The DAYOFWEEK function returns the day of the week for a given date, optionally using different numbering modes. It is used in scheduling, reporting, calendar logic, and date classification.
Compatibility
▾| Excel | ✖ |
| Gnumeric | ✔ |
| Google_sheets | ✖ |
| Libreoffice | ✔ |
| Numbers | ✔ |
| Onlyoffice | ✔ |
| Openoffice | ✔ |
| Wps | ✔ |
| Zoho | ✔ |
What the DAYOFWEEK Function Does ▾
- Returns a numeric weekday index
- Supports multiple week‑start conventions
- Works with any valid Calc date
- Useful for scheduling, classification, and calendar logic
Syntax ▾
DAYOFWEEK(date; [mode])
Arguments
-
date:
A valid date or serial number. -
mode (optional):
Determines which day is considered the first day of the week.
Mode Table
| Mode | Week Starts On | Return Values |
|---|---|---|
| 1 (default) | Sunday | 1 = Sun … 7 = Sat |
| 2 | Monday | 1 = Mon … 7 = Sun |
| 3 | Monday | 0 = Mon … 6 = Sun |
Basic Examples ▾
Default mode (Sunday = 1)
=DAYOFWEEK("2026-04-02")
→ 5 (Thursday)
Monday‑based week
=DAYOFWEEK("2026-04-02"; 2)
→ 4
Zero‑based Monday week
=DAYOFWEEK("2026-04-02"; 3)
→ 3
Advanced Examples ▾
Return the weekday name
=TEXT(A1; "NNNN")
Check if a date is a weekend
=DAYOFWEEK(A1; 2) > 5
Assign workday vs weekend labels
=IF(DAYOFWEEK(A1;2) <= 5; "Workday"; "Weekend")
Filter only Mondays
=DAYOFWEEK(A1; 2) = 1
Combine with DATEVALUE
=DAYOFWEEK(DATEVALUE("2026-04-02"))
Use with WEEKNUM for calendar logic
=WEEKNUM(A1; 2) & "-" & DAYOFWEEK(A1; 2)
Edge Cases and Behavior Details ▾
DAYOFWEEK returns a number, not text
Use TEXT() to get weekday names.
Behavior details
- Dates must be valid Calc dates
- Text dates depend on locale
- Serial numbers work directly
- Mode affects numbering only, not the underlying date
Invalid date → Err:502
Common Errors and Fixes ▾
Err:502 — Invalid argument
Cause:
- Invalid date
- Text not recognized as a date
Fix:
- Use DATE(Y;M;D)
- Use DATEVALUE for text dates
Wrong weekday number
Cause:
- Incorrect mode
Fix:
- Choose the correct mode (1, 2, or 3)
Best Practices ▾
- Use mode 2 for ISO‑style Monday‑first weeks
- Use TEXT() for weekday names
- Validate dates with DATEVALUE when importing text
- Use DAYOFWEEK for scheduling, classification, and reporting logic
- Combine with WEEKNUM and ISOWEEKNUM for calendar systems
DAYOFWEEK is the simplest way to classify dates into weekdays, weekends, and scheduling categories — especially when paired with TEXT() and WEEKNUM.
Related Patterns and Alternatives ▾
- WEEKDAY — Excel‑compatible version
- ISOWEEKNUM — ISO week number
- WEEKNUM — standard week number
- DAY / MONTH / YEAR — extract components
- DATE / DATEVALUE — construct dates
By mastering DAYOFWEEK, you can build robust scheduling, reporting, and calendar‑driven models in LibreOffice Calc.