Calligra Sheets DAY Function: Extract the Day of a Date
Learn the DAY function in Calligra Sheets with exact versioned syntax, worked date examples, advanced reporting uses, locale pitfalls, and source-checked limitations.
Verification status: Consult the documentation, examples and any stated test scope below. How formula examples are checked
Availability and version history
- Introduced: Documented by 26.08.2; original introduction not established.
- Availability: Supported in Calligra Sheets 26.08.2, based on the function-specific registration.
- Scope: The official application listing provides Linux installation; other packaged builds are unverified here.
- Checked: October 14, 2026. Documentation/source check; no new native test in Calligra Sheets 26.08.2.
Quick answer
The DAY function extracts the day of the month, not the weekday. For February 29, 2024, =DAY(DATE(2024;2;29)) has an expected result of 29. DAY is not the same as the separately registered DAYS, DAYOFYEAR, or WEEKDAY functions.
Applies to: the function registry and implementations from Calligra Sheets 26.08.2, released October 8, 2026, examined October 12, 2026. KDE’s current application listing supports Linux via distribution packages/Flatpak; this guide does not claim that every version/platform executes identically. Results marked expected below were calculated independently or inferred from source. Calligra Sheets was not installed or run to observe them.
Exact syntax and required argument
=DAY(date)
date(required, exactly one argument): an actual date value, an applicable cell reference containing a date, or an expression evaluated as a date. The published function XML describes the parameter as a String/Text, while the pinned implementation immediately converts it throughValueConverter::asDatebefore extracting its calendar component. Date strings are locale sensitive; an authentic date value is safest. Argument order is simply the one date to examine; there are no optional parameters or default values in the pinned registration.- Return: a whole number from 1 to 31. The code uses Qt
QDateand returns a numericValuerather than a formatted date string. Choose a General/Number display format for result cells so the integer is visible. - Example:
=DAY(DATE(2024;2;29))→ expected29. The nested DATE call uses three required integer arguments in year, month, day order.
Important KDE documentation/source discrepancy
The older official KDE handbook entry says that leaving out date gives the current day of the month. The pinned Calligra 26.08.2 source does not register a zero-argument overload. It registers DAY without calling setParamCount, while Function.cpp defaults to one mandatory argument and its execution-time validation rejects zero with a VALUE-class error. Thus =DAY() should not be recommended; its exact cell-visible error spelling has not been observed in a native application. To extract a value from the current date, the proposed alternative is:
=DAY(TODAY())
Here the result changes with the real date and recalculation settings. Unlike =DAY(), it supplies a date value; native execution remains untested.
Language, locale and typing
The official KDE handbook shows semicolon-separated multiargument functions, for example DATE(2024;2;29). Localized spreadsheets may use different decimal notation and input conventions: follow the installed Insert Function guidance and use the locale-appropriate separator if necessary. "2/22/2002" appears as a text-date example in KDE’s documentation, but parsing an ambiguous quoted date is not guaranteed across locale or platform. For reproducible examples, construct date cells using DATE, or import real date values and inspect their type.
Worked example: extract day of the month from four dates
Enter A1 as Input date and B1 as DAY result. In A2:A5 enter the date-creating formulas exactly as shown. These formulas produce the display dates in an appropriate ISO-style date format; adjust the display formatting only, not the underlying date values.
| Cell | Formula entered in A | Date value represented | Expected =DAY(A2) copied down in B |
|---|---|---|---|
| A2 | =DATE(2024;2;29) |
2024-02-29 | 29 |
| A3 | =DATE(2025;1;1) |
2025-01-01 | 1 |
| A4 | =DATE(2000;12;31) |
2000-12-31 | 31 |
| A5 | =DATE(2026;10;12) |
2026-10-12 | 12 |
Then type =DAY(A2) into B2 and fill it through B5, letting the relative reference change to A3/A4/A5. The final column contains independently calculated expected values, not software-observed output.
Why this works: each input is an unambiguous date created from its year, month and day; the func_day implementation converts to a date, checks for conversion errors, and extracts QDate::day(). The four dates were cross-checked with an independent Gregorian calendar calculation.
Practical scenario: route orders by their calendar-day window
Suppose a retailer reviews orders placed during the first seven days of each month. With the dates from the table above, enter in C2 and fill down:
=IF(DAY(A2)<=7;"First-week window";"Day 8 or later")
The independently reasoned expected results are:
| Date cell | DAY result | Expected C result |
|---|---|---|
| A2 (2024-02-29) | 29 | Day 8 or later |
| A3 (2025-01-01) | 1 | First-week window |
| A4 (2000-12-31) | 31 | Day 8 or later |
| A5 (2026-10-12) | 12 | Day 8 or later |
This groups by day of month and does not identify the first seven business days. It deliberately uses only the documented IF and DAY ideas; the formula has not been executed in Calligra.
Another application: classify late-month entries
=IF(DAY(A2)>=29;"Late-month review";"Regular review")
For A2 (February 29, 2024), the expected label is Late-month review. This is a configurable 29th-day business rule, not a claim that every month contains 29 days or that the day is always the month’s last day.
Errors, limitations and troubleshooting
-
DAY versus WEEKDAY or DAYS:
DAYgives the number within the month (1–31); it does not return a weekday or count elapsed days.DAYSandDAYOFYEARare separate Calligra registry names, not synonyms. -
Valid leap days:
=DAY(DATE(2024;2;29))has expected result 29. A non-leap February 29 and arbitrary out-of-range input need their own runtime check; do not assume every app rejects or normalizes them identically. -
Zeros in the DATE constructor: the examined
DATEcallback returns a VALUE-class error when its month or day is exactly zero, so=DAY(DATE(2024;2;0))is not a safe last-day-of-previous-month trick in this source version. -
Imported dates represented as text: a cell looking like
02/29/2024may be stored as text or parsed using a different locale. Prefer a genuine date cell orDATE(year;month;day). -
Wrong argument count: zero parameters or two parameters do not match the one-argument registration. The engine checks argument count and returns a VALUE-class error at source level. Confirm the rendered error text in the version actually installed.
-
Non-date or invalid reference: the function first calls
asDate, and returns its error result when conversion fails. The precise accepted date text, serial/date-base interpretation, and display/error behavior need native validation. -
The answer looks like a date instead of a number: change the output cell format to General or Number; cell formatting does not change the semantic meaning of DAY.
-
Examples use the wrong calendar convention: use
DATE(year;month;day)rather than ambiguous slash-separated strings, and check that the imported data represents local dates rather than unparsed text. -
Runtime/portability limits: the source inspection establishes 26.08.2 logic and function registration; it does not establish every operating-system binary, plugin build, number format, timezone interaction, or spreadsheet application’s edge-case result.
Cross-software compatibility: Excel and other spreadsheets
Excel calls the argument serial_number, requires it, and returns day values 1–31. The equivalent intent is portable (=DAY(A2)), but Excel’s serial-date conventions and automatic text parsing must not be taken as evidence of Calligra’s interpretation. Excel examples often show commas between DATE arguments; this guide follows the semicolon convention documented by KDE. Microsoft’s official Excel DAY documentation was independently checked October 12, 2026. This comparison refers only to the expressly documented shared purpose; no Excel result is used as proof of Calligra runtime behavior. DAY has no explicit alternate registered name in the pinned Calligra catalogue.
Related functions and checked sources
KDE separately registers DATE to construct a date; TODAY to provide the current date; and the other component functions DAY, MONTH, YEAR. These are related functions, not aliases. See the official source links below.
- Official KDE DAY handbook entry — syntax, one date parameter, date-text examples and the contradictory optional-argument claim; accessed 2026-10-12.
- Pinned Calligra 26.08.2
datetime.cppfunction registration and implementation — source-checked DAY arity, date conversion, error propagation and extraction; checked 2026-10-12. - Pinned
datetime.xmldescription — documented argument and return types, syntax and examples; checked 2026-10-12. - Default minimum/maximum function argument count and arity guard — explains the contradiction with the handbook’s no-argument claim; checked 2026-10-12.
- Pinned DATE constructor and month/day zero guard — supports reproducible date values and the zero-input caveat; checked 2026-10-12.
- KDE Calligra Sheets releases — latest listed stable release 26.08.2 (2026-10-08) as checked 2026-10-12.
- Microsoft Excel DAY reference — comparison only; checked 2026-10-12.
Testing limitation: Examples are independently calculated expectations. Native locale, date conversion and visible error behavior remain untested.