WEEKDAY Function in ONLYOFFICE: Syntax, Week-Date Examples and Troubleshooting
Number calendar weekdays with officially documented Sunday-first, Monday-first and zero-based options, tested expected tables and portability cautions.
Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in ONLYOFFICE Spreadsheet Editor. How formula examples are checked
WEEKDAY in ONLYOFFICE Spreadsheet Editor
Quick answer
WEEKDAY converts a spreadsheet date into a numbered day of the week. Use =WEEKDAY(DATE(2021,1,1),2) to predict 5 because January 1, 2021 was a Friday and mode 2 numbers Monday as 1 through Sunday as 7. The official ONLYOFFICE WEEKDAY reference documents the argument order and permitted modes. This output is independently calculated, not observed in the application.
When to use it
Use WEEKDAY to identify weekend rows, schedule work-week reporting, or assign a weekday category to dates imported from another system. It returns a numeric label, not a translated day name, and is not itself a week-number function. For ISO-style day numbering choose return_type=2; for Sunday-first numbering omit the second argument. A date formatted as Friday and the number 5 from mode 2 represent different result formats.
Exact documented syntax, order, defaults and argument types
=WEEKDAY(serial_number, [return_type])
| Argument | Required? | Meaning | Documented default |
|---|---|---|---|
serial_number |
Yes | Date serial, cell containing a date, or output from a date/time function such as DATE |
No omission default |
return_type |
No | Numeric choice of weekday numbering | 1 (Sunday=1) |
The ONLYOFFICE function page explicitly lists only 1 (or omitted), 2 and 3. This is important: Excel also documents 11–17, but their support in ONLYOFFICE is not established by this official ONLYOFFICE page. Don’t recommend those extra types without an application test. ONLYOFFICE mode table; Excel comparison.
| Return type | Monday | Tuesday | Wednesday | Thursday | Friday | Saturday | Sunday |
|---|---|---|---|---|---|---|---|
1 or omitted |
2 | 3 | 4 | 5 | 6 | 7 | 1 |
2 |
1 | 2 | 3 | 4 | 5 | 6 | 7 |
3 |
0 | 1 | 2 | 3 | 4 | 5 | 6 |
Reproducible practice sheet
Enter Date, Calendar day, Sunday=1, Monday=1, Monday=0 into A1:E1. Fill A2:A13 using =DATE(2019,12,30) in A2 and the 11 other dates in the table below as DATE formulas; do not paste locale-ambiguous text. Enter the calendar day names in B for reading convenience (they are independent labels, not formula results). Enter =WEEKDAY(A2) in C2, =WEEKDAY(A2,2) in D2 and =WEEKDAY(A2,3) in E2 and fill downward. Expected values:
| Date in A | Calendar day (independent) | WEEKDAY(A,1) | WEEKDAY(A,2) | WEEKDAY(A,3) |
|---|---|---|---|---|
| 2019-12-30 | Monday | 2 | 1 | 0 |
| 2020-01-01 | Wednesday | 4 | 3 | 2 |
| 2020-12-31 | Thursday | 5 | 4 | 3 |
| 2021-01-01 | Friday | 6 | 5 | 4 |
| 2021-01-03 | Sunday | 1 | 7 | 6 |
| 2021-01-04 | Monday | 2 | 1 | 0 |
| 2024-01-01 | Monday | 2 | 1 | 0 |
| 2024-12-29 | Sunday | 1 | 7 | 6 |
| 2024-12-30 | Monday | 2 | 1 | 0 |
| 2025-01-01 | Wednesday | 4 | 3 | 2 |
| 2026-01-01 | Thursday | 5 | 4 | 3 |
| 2026-10-11 | Sunday | 1 | 7 | 6 |
All expected outputs were computed with Python’s datetime.weekday() and verified separately against datetime.isoweekday() for type 2. They are expected, not native execution observations. The companion CSV records every input and expected result.
Worked examples and advanced use
1. Basic weekday number. Enter =WEEKDAY(DATE(2024,1,1)). Independent expectation: 2 (Monday is the second day when Sunday=1). Enter =WEEKDAY(DATE(2024,1,1),2) and expect 1. These two formulas do not disagree: they use different numbering systems.
2. Decide whether a record falls on a weekend. With a date in A2, enter:
=IF(WEEKDAY(A2,2)>5,"Weekend","Workday")
For A2=DATE(2021,1,3) (Sunday), independently expected Weekend. For A2=DATE(2021,1,4) (Monday), independently expected Workday. This is a weekday-only classification; it does not account for local statutory holidays.
3. Count Saturday and Sunday records without relying on text day names. In F2 write =IF(WEEKDAY(A2,2)>5,1,0) and fill through F13. Independently count the result column: the number of weekend dates in the 12-row fixture is 3. This avoids localized day-name matching. Test the result in the native editor before using it in production.
4. Start weeks on Monday without changing the calendar date. =WEEKDAY(DATE(2020,1,1),2) predicts 3 (Wednesday), whereas =WEEKDAY(DATE(2020,1,1),3) predicts 2. Mode 3 is zero-based; do not use a 1–7 lookup table with its output.
5. Use WEEKDAY with weekly reporting only after deciding the week-number definition. WEEKDAY alone cannot tell whether January 1 is in ISO week 1. To identify week groups, use WEEKNUM with its documented return type or ISOWEEKNUM; these return week numbers, not weekday numbers.
Troubleshooting and limits
| Symptom | Likely cause | Safer verification |
|---|---|---|
Sunday displays 1, but you expected 7 |
Default return type is Sunday-first | Use ,2 explicitly. |
Monday displays 0 |
Return type 3 is zero-based |
Use ,2 for Monday=1. |
| Results differ after CSV import | Source dates may be parsed under another regional format or stored as text | Replace a row with =DATE(2021,1,1) and check independently. |
| A mode accepted in Excel gives an error or unexpected result | ONLYOFFICE lists only 1, 2 and 3 | Use documented modes; treat others as unverified. |
| An invalid argument appears to be accepted or rejected | Error behaviour was not native-tested | Check the exact error in your build; do not assume Excel error codes are identical. |
| Same day, different date serial | Workbook may use the 1904 date system | Verify date system and import settings. |
The ONLYOFFICE article does not specify error codes for invalid return_type, negative serials, or text that cannot be parsed as a date. Such outcomes remain unverified here.
Cross-spreadsheet compatibility: precise scope
Microsoft Excel’s WEEKDAY documentation matches return types 1–3, but it additionally describes return types 11–17. Those extra types are Excel-documented, not verified for ONLYOFFICE. Nothing in this page confirms Apple Numbers, Google Sheets, or Calc behaviour, localized names, or their earliest versions. Prefer DATE inputs and explicit type 2 when portable 1–7 Monday-first numbering is needed, then test on both platforms.
Product scope, regional settings and test status
These examples use the English, unversioned ONLYOFFICE Spreadsheet Editor help as accessed October 11, 2026. That establishes documented function names and parameters, but does not establish a minimum supported Docs web edition, a minimum Desktop Editors build, or mobile editor parity. There is no running ONLYOFFICE editor in this research environment. None of the results on this page was observed in ONLYOFFICE. The tables are independently calculated predictions for someone to reproduce and verify in a real build.
- Docs / web: the vendor documents this function in its general Spreadsheet Editor reference, but this batch did not test a particular server version, integration or browser.
- Desktop: Desktop Editors have a separate release history and were not executed. Do not describe the results as Desktop-tested.
- Mobile / older releases: support and recalculation behaviour are not established by the undated help page. Check the function picker on the exact target build.
- Formula names and arguments: in the English reference, formulas use English names, commas to separate arguments, and parentheses. Advanced Settings has a Formula Language option; verify localized names and separators before copying examples into another locale. The comma notation is only guaranteed as the documented English form, not as universal pasted syntax.
- Date presentation: enter dates with
=DATE(year,month,day)or explicit typed date cells. Region can affect displayed date order and interpretation of pasted date text. Avoid"01/02/2026"as an ambiguous text date. The vendor also documents an optional 1904 date system, so do not mix serial-number literals between imported workbooks without checking the date system. - Recalculation: if recalculation is unexpected, check the application’s calculation and workbook settings; no recalculation performance was tested.
Sources: ONLYOFFICE Insert Functions, ONLYOFFICE Advanced Settings.
Related verified resources and editorial checks
-
ONLYOFFICE DATE function — build unambiguous input dates.
-
ONLYOFFICE WEEKNUM function — compute week-of-year numbers, not weekday numbers.
-
ONLYOFFICE ISOWEEKNUM function — use ISO numbering when the week-year convention is important.
Official reference and verification
- ONLYOFFICE Spreadsheet Editor — function documentation
- ONLYOFFICE Insert Functions
- ONLYOFFICE Advanced Settings
- ONLYOFFICE DATE function
- ONLYOFFICE WEEKNUM function
- ONLYOFFICE ISOWEEKNUM function
Verification status: Official documentation checked; example outcomes were independently reasoned or arithmetically checked where applicable. Not executed in ONLYOFFICE Spreadsheet Editor.
- No genuine ONLYOFFICE Spreadsheet Editor screenshots are included; this guide does not use mock application images.