Contact

WEEKS in Collabora Office: Distinguish Seven-Day Intervals From Calendar Weeks

Date & Time Intermediate Collabora Office Calc

Use Collabora WEEKS to count elapsed whole weeks or Monday boundaries, with explicit date inputs and reproducible boundary examples.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: =WEEKS(DATE(2022;1;12);DATE(2022;1;17);0) has documented result 0, while the same call with Type=1 has documented result 1. Five days have elapsed, but the interval reaches a Monday.

Syntax and the two meanings of a week

=WEEKS(StartDate; EndDate; Type)

All three arguments are required. StartDate and EndDate are valid dates. The dedicated Collabora help requires EndDate to be later than StartDate and says an error is returned otherwise; it does not specify an exact error code.

Type=0 counts complete seven-day intervals without aligning to a weekday. Type=1 counts calendar-week boundaries: each Monday after the start date through the end date adds one. The source explicitly makes Monday the boundary regardless of current locale.

Do not assume this function returns fractional weeks. For the ordinary date-only intervals here, the interval mode counts complete seven-day spans. If fractional elapsed weeks are desired, (EndDate-StartDate)/7 is a separate arithmetic calculation with a different result.

Example 1: reproduce the documented boundary

Enter =DATE(2022;1;12) in A2 and =DATE(2022;1;17) in B2. They are Wednesday and the following Monday. In C2 enter =WEEKS(A2;B2;0) and in D2 enter =WEEKS(A2;B2;1).

The documented targets are 0 and 1 respectively. =B2-A2 has independent target 5 days. The apparent disagreement is explained by the different counting rules, not a locale-related first-day-of-week change.

In row three, use the same start but end on January 19. Seven days have elapsed, so Type=0 targets 1. There is also one intervening Monday, so Type=1 targets 1. Agreement for one example does not make the modes interchangeable.

Example 2: cross a boundary in a single day

Use Sunday January 16, 2022 as the start and Monday January 17 as the end. The independent Type=0 target is 0 and the calendar-boundary target is 1.

Conversely, starting Monday January 17 and ending Sunday January 23 gives six elapsed days but no additional Monday. Both modes target 0. The starting Monday itself is excluded from the calendar-boundary count, as the documentation specifies.

Keep these short examples in a test sheet if a report depends on calendar weeks. A long interval can conceal a one-week alignment error that becomes obvious at a single boundary.

Advanced application: compare reporting cutoffs

Start on Wednesday January 12 and end Monday January 24. The elapsed span is twelve days, so interval mode targets 1 complete week. Calendar mode counts Mondays January 17 and January 24, targeting 2.

A report counting reporting-week transitions may want the second rule. A duration threshold requiring fourteen elapsed days should not treat that calendar result of two as proof that fourteen days have passed. Match the function mode to the actual rule.

Date entry and troubleshooting

Use DATE expressions or cells already containing real spreadsheet dates. A bare expression such as 1/12/2022 is division, not a reliable date literal. Text dates can depend on locale parsing, so these controls avoid them.

The source requires end later than start. Validate this order rather than applying ABS to a result or silently reversing the inputs. Same-date and reverse-date native errors were not executed here.

Datetime fractions and extreme date ranges are outside the controls. For a date-only reporting model, decide explicitly whether to remove time components before calling WEEKS. Formatting a datetime to hide its time does not change the stored value.

Availability, format and verification

Collabora Office 26.04 desktop help documents this exact function. The saved source was retrieved on 2026-10-13 and hash-verified for this guide on October 15, 2026. It identifies the namespace ORG.OPENOFFICE.WEEKS and says the function is outside the cited OpenFormula 1.3 standard. This is not cross-product semantic certification.

The first introduced release and last functioning version are unknown. Online/mobile availability is not inferred. No native Collabora or WPS execution was performed. Results are independent calendar/string controls or explicitly identified documented examples. English names and semicolon separators are used.

References