Contact

DAYS Function (Calligra Sheets)

Date & Time Intermediate Calligra Sheets

Calculate calendar-day differences with DAYS in Calligra Sheets. Learn the end/start order, date-only conversion and tested invalid-input pitfalls.

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

Input warning: Calligra Sheets 25.04.2 engine tests converted the tested malformed text and input errors into the reference date instead of propagating an error. Validate date inputs before relying on a plausible-looking day count.

Quick answer: =DAYS(DATE(2025;4;15);DATE(2025;1;15)) returns 90 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 DAYS returns

DAYS subtracts the second calendar date from the first. Put the later date first for a positive result. Time-of-day fractions are discarded separately from each input, so this counts calendar-date boundaries rather than complete elapsed 24-hour periods. The versioned help contains a reversed-sign example: its February 22 then February 26 order actually returned −4 in the tested engine. Official function reference.

Syntax and arguments

=DAYS(end_date;start_date)

end_date and start_date are required date values or numeric date serials. Use DATE to make unambiguous inputs. Both arguments are required; there is no optional mode. Numeric date conversion uses the floor of the serial, including negative serials. 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
=DAYS(DATE(2025;4;15);DATE(2025;1;15)) 90 90
=DAYS(DATE(2025;1;15);DATE(2025;4;15)) -90 -90
=DAYS(DATE(2025;1;15);DATE(2025;1;15)) 0 0
=DAYS(DATE(2024;3;1);DATE(2024;2;28)) 2 2
=DAYS(DATE(2025;3;1);DATE(2025;2;28)) 1 1
=DAYS(DATE(2026;1;1);DATE(2025;1;1)) 365 365
=DAYS(DATE(2025;1;15)+TIME(18;0;0);DATE(2025;1;15)+TIME(6;0;0)) 0 0
=DAYS(DATE(2025;1;15)+1+TIME(1;0;0);DATE(2025;1;15)+TIME(23;0;0)) 1 1

Practical worksheet

Put =DATE(2025;1;15) in A2 and =DATE(2025;4;15) in B2. Then =DAYS(B2;A2) counts 90 calendar days. =DAYS(A2;B2) gives −90. Label the result Calendar days so readers do not confuse it with working days or months.

For timestamps on the same date, 06:00 and 18:00 both reduce to that date and DAYS returns zero. Conversely, 23:00 followed by 01:00 the next day crosses one calendar boundary even though only two hours elapsed. Keep timestamps intact and subtract them directly if elapsed time is the intended quantity.

Advanced interpretation and checks

For valid date-only values, swapping the arguments reverses the sign. The following independently reconstructed and executed check therefore gives zero. This property does not make invalid inputs safe: the source first converts each value and then extracts its date without checking the conversion error.

The default reference date in the tested engine is December 30, 1899. That explains the surprising −45,672 result for DAYS("abc";DATE(2025;1;15)). It is not a meaningful interpretation of the text. The separate test =DAYS(-.5;0) returned −1, consistent with flooring numeric serials.

=DAYS(DATE(2025;4;15);DATE(2025;1;15))+DAYS(DATE(2025;1;15);DATE(2025;4;15))

The executed result was 0.

Boundaries and troubleshooting

Do not use a successful numeric result as a date-validity test. The observed division-by-zero inputs were also converted to the reference date. The inspected converter can use the current date for Boolean or empty values; those volatile date cases were not executed. Explicit DATE expressions keep these examples independent of text-date parsing and locale. Wrong argument counts returned actual #VALUE! errors.

Formula Engine result
=DAYS(1;0) 1
=DAYS(0;1) -1
=DAYS("abc";DATE(2025;1;15)) -45672
=DAYS(1/0;DATE(2025;1;15)) -45672
=DAYS(DATE(2025;1;15);1/0) 45672
=DAYS(DATE(2025;1;15)) #VALUE!
=DAYS(DATE(2025;1;15);DATE(2025;4;15);0) #VALUE!
=DAYS(DATE(2002;2;22);DATE(2002;2;26)) -4
=DAYS(-.5;0) -1

Official evidence and precision scope

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.