WEEKS Function (Calligra Sheets)
Calculate weeks between dates in Calligra Sheets and check mode-one endpoint limits, locale week starts and signed truncation with reproducible examples.
Verification status: 18 selected formulas were executed through the Calligra Sheets 25.04.2 calculation engine library in the C locale. Deterministic results were independently reconstructed; 26.08.2 was source-checked only. No GUI-cell or import claim. How formula examples are checked
Mode 1 limitation: With the tested C locale’s Monday week start, one Monday to the next returned 0, while an identical Monday pair returned −1. Use a separately defined boundary-count expression when that is the quantity you need.
Quick answer: =WEEKS(DATE(2025;1;1);DATE(2025;1;15);0) returns 2 in the tested engine.
Availability and version history
- Introduced: First release not established; the name is present in Calligra 2.4.0 source.
- Supported in: Calligra Sheets 26.08.2, with the limitations described here; no retirement established.
- Scope: Desktop Sheets with the Date & Time module. Formulas use English names and semicolon separators.
- Checked: October 14, 2026: selected 25.04.2 engine-library formulas and independent calendar/time reconstructions; 26.08.2 source only. The test locale was C, with Monday as its week start. No GUI-cell or import execution is claimed.
What WEEKS returns
Mode 0 divides the signed calendar-day difference by seven and truncates toward zero. Mode 1 adjusts both endpoints using the locale’s first day of the week before the same integer division. Its source comment mentions Mondays, but the code actually reads the locale setting. The retained locale observation established Monday for these engine tests. Official function reference.
Syntax and arguments
=WEEKS(start_date;end_date;type)
start_date, end_date and type are required. Use 0 for elapsed full seven-day units or the documented 1 for the locale-based branch. Any nonzero converted integer takes that branch. A partial negative week truncates toward zero: a six-day reverse span gives zero, not −1. Registration and implementation.
Reproducible engine examples
Numeric results are rounded here to twelve decimal places. The reconstruction column applies independent calendar arithmetic or the explicitly inspected time/conversion rule. Date serials use the tested default reference date; they do not show native GUI date formatting.
| Formula | Engine result | Independently reconstructed calendar or time rule |
|---|---|---|
=WEEKS(DATE(2025;1;1);DATE(2025;1;15);0) |
2 |
2 |
=WEEKS(DATE(2025;1;1);DATE(2025;1;15);1) |
1 |
1 |
=WEEKS(DATE(2025;1;6);DATE(2025;1;13);1) |
0 |
0 |
=WEEKS(DATE(2025;1;6);DATE(2025;1;6);1) |
-1 |
-1 |
=WEEKS(DATE(2021;1;1);DATE(2021;1;4);1) |
0 |
0 |
=WEEKS(DATE(2025;1;15);DATE(2025;1;1);0) |
-2 |
-2 |
=WEEKS(DATE(2025;1;6);DATE(2025;1;12);0) |
0 |
0 |
=WEEKS(DATE(2025;1;12);DATE(2025;1;6);0) |
0 |
0 |
Practical worksheet
For January 1 to January 15, 2025, =WEEKS(DATE(2025;1;1);DATE(2025;1;15);0) gives 2. Mode 1 gives 1 in the tested Monday-start locale. Those two values answer different endpoint questions.
Do not divide a subtraction of calendar week numbers to measure elapsed weeks: week numbers restart and can belong to a neighboring week-year. The mode-0 expression already uses the date difference directly.
Advanced interpretation and checks
For an explicit Monday-boundary count, put =DATE(2021;1;1) in A2 and =DATE(2021;1;4) in B2. Use =(DAYS(B2;A2)+WEEKDAY(A2;2)-WEEKDAY(B2;2))/7. It measures the difference between the Mondays of the containing weeks. The full expression below returned 1, whereas WEEKS with mode 1 returned 0 for those dates.
This alternative deliberately defines Monday as the boundary. It does not count complete elapsed seven-day periods and does not automatically adopt another locale’s week start.
=(DAYS(DATE(2021;1;4);DATE(2021;1;1))+WEEKDAY(DATE(2021;1;1);2)-WEEKDAY(DATE(2021;1;4);2))/7
The executed result was 1.
Boundaries and troubleshooting
Mode 1 subtracts the span to the next week start even when the first date is already on that boundary. Reversed dates can give an extra negative unit; the shown January 15 to January 1 case returned −3. Invalid date text and errors were converted into the reference date in the tested inputs. The required mode must not be omitted. Boolean or empty date conversion can consult the clock and was not tested here.
| Formula | Engine result |
|---|---|
=WEEKS(DATE(2025;1;15);DATE(2025;1;1);1) |
-3 |
=WEEKS(DATE(2025;1;1);DATE(2025;1;15);2) |
1 |
=WEEKS(DATE(2025;1;1);DATE(2025;1;15);.9) |
2 |
=WEEKS(DATE(2025;1;15);DATE(2025;4;15);"abc") |
12 |
=WEEKS(DATE(2025;1;15);DATE(2025;4;15);1/0) |
12 |
=WEEKS("abc";DATE(2025;4;15);0) |
6537 |
=WEEKS(1/0;DATE(2025;4;15);0) |
6537 |
=WEEKS(DATE(2025;1;15);DATE(2025;4;15)) |
#VALUE! |
=WEEKS(DATE(2025;1;15);DATE(2025;4;15);0;0) |
#VALUE! |
Official evidence and precision scope
- Function-specific implementation
- Versioned help
- Date Conversion
- Integer Conversion
- Week Start
- Locale Default
- Reference Date
The selected callbacks, date/time module and inspected conversion/time helpers are byte-identical between the retained 25.04.2 and 26.08.2 sources. This establishes source continuity for the described paths, not execution of the later release.