WEEKDAY Function (LibreOffice Calc)
The WEEKDAY function returns the day of the week for a given date, using one of several numbering systems. It is essential for scheduling, calendars, dashboards, and weekday-based logic.
Verification status: Consult the documentation, examples and any stated test scope below. How formula examples are checked
Availability and version history
- Introduced: Documented by LibreOffice 26.8.1.1; original introduction not established.
- Availability: Supported in LibreOffice 26.8.1.1, verified against its function registry. This identifies a supported release, not a final working version.
- Scope: Desktop Calc, using the English function name. Availability in other spreadsheet applications is separate.
- Checked: 2026-10-14 — function reference; versioned support. Documentation/source check; not a new native test. Existing example-specific test claims below retain their stated scope.
What the WEEKDAY Function Does
- Returns the day of the week as a number
- Supports multiple numbering systems
- Works with real dates, serial numbers, and DATEVALUE
- Ignores time components
It is designed to be flexible, locale‑aware, and ideal for weekday logic.
Syntax
WEEKDAY(date; [mode])
Arguments
-
date:
A valid date or serial number. -
mode (optional):
Determines the numbering system.
Numbering Systems
| Mode | Meaning | Week Starts On | Returns |
|---|---|---|---|
| 1 (default) | Sunday = 1 | Sunday | 1–7 |
| 2 | Monday = 1 | Monday | 1–7 |
| 3 | Monday = 0 | Monday | 0–6 |
Notes:
- Mode 2 is the most common for business logic.
- Mode 3 is ideal for zero‑based indexing.
Basic Examples
Default behavior (Sunday = 1)
=WEEKDAY("2024-03-15")
Monday = 1
=WEEKDAY("2024-03-15"; 2)
Monday = 0 (zero‑based)
=WEEKDAY("2024-03-15"; 3)
Using a cell reference
=WEEKDAY(A1)
Weekday of today
=WEEKDAY(TODAY(); 2)
Advanced Examples
Convert weekday number to name
=TEXT(A1; "NNNN")
Check if a date is a weekend (Mode 2)
=WEEKDAY(A1;2)>5
Check if a date is a weekday
=WEEKDAY(A1;2)<=5
Get next Monday
=A1 + MOD(1 - WEEKDAY(A1;2); 7)
Get previous Monday
=A1 - MOD(WEEKDAY(A1;2)-1; 7)
Get next business day
=A1 + IF(WEEKDAY(A1;2)>=5; 8-WEEKDAY(A1;2); 1)
Extract weekday from text using DATEVALUE
=WEEKDAY(DATEVALUE(A1); 2)
Extract weekday from imported CSV timestamp
=WEEKDAY(DATEVALUE(LEFT(A1;10)); 2)
Extract weekday from Excel serial date stored as text
=WEEKDAY(DATE(1899;12;30)+VALUE(A1); 2)
Build a weekday label (e.g., “Mon”)
=TEXT(A1; "NNN")
Build a full weekday label (e.g., “Monday”)
=TEXT(A1; "NNNN")
Edge Cases and Behavior Details
WEEKDAY returns an integer (0–7 depending on mode)
Accepts:
- Real dates
- Serial numbers
- DATEVALUE outputs
- ISO date strings
Invalid text → Err:502
Time components are ignored
WEEKDAY may differ from ISOWEEKNUM
WEEKDAY of an error → error propagates
Zero‑based mode (3) is useful for indexing arrays
Common Errors and Fixes
Err:502 — Invalid argument
Cause:
- Text not recognized as a date
- Non-numeric values
Fix:
- Wrap with DATEVALUE
- Clean text with TRIM or SUBSTITUTE
Wrong weekday due to mode confusion
Fix:
- Use mode 2 for Monday‑start logic
- Use mode 3 for zero‑based indexing
Wrong result due to text dates
Fix:
- Normalize with DATEVALUE
Best Practices
- Use mode 2 (Monday = 1) for business logic
- Use mode 3 (Monday = 0) for indexing
- Normalize text dates with DATEVALUE
- Use WEEKDAY with TEXT() to build labels
- Use WEEKDAY for scheduling, calendars, and dashboards
Related Patterns and Alternatives
- Use ISOWEEKNUM for ISO‑8601 week numbering
- Use WEEKNUM for locale‑specific week numbering
- Use DATE for constructing comparison dates
- Use DATEDIF and DAYS for interval calculations
By mastering WEEKDAY and its companion functions, you can build powerful, flexible, and fully dynamic weekday‑based workflows in LibreOffice Calc.
Reproducible example (tested in LibreOffice Calc)
This standalone example was calculated in LibreOffice Calc 25.2.3.2 and matched the expected value. It is a practical cross-check of one usage, not proof that every example elsewhere on this page is correct.
=WEEKDAY(DATE(2025;1;12);2)
Expected result: 7.
Number weekdays with Monday equal to 1.
If the result differs, check the referenced cells, argument separators and number formatting. For more information, consult the LibreOffice Calc official help.