DAY Function (OpenOffice Calc)
Learn the DAY function in Apache OpenOffice Calc: Returns the sequential date of the month as an integer (1-31) in relation to the date value.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Availability and version history
- Introduced: Documented by Apache OpenOffice 4.1.16; original introduction not established.
- Availability: Supported in Apache OpenOffice 4.1.16, verified against its function registry. This identifies a supported release, not a final working version.
- Scope: Desktop Calc, using the English function name. Availability in other spreadsheet applications is separate.
- Checked: 2026-10-14 — function reference; versioned support. Documentation/source check; not a new native test. Existing example-specific test claims below retain their stated scope.
DAY extracts the day of the month from a numeric date: ordinary results range from 1 to 31. It does not identify the weekday and does not measure the number of days between two dates. The source callback floors the serial’s date portion and reads the day component relative to the document’s base date.
Syntax and arguments
=DAY(date_value)
One date or date-time value is required. Use a numeric date made by DATE or a reference to a known date cell. The date-time fraction is excluded for the ordinary modern examples. A bare integer is interpreted as a date serial, not as a requested day-of-month label. Examples use English function names and semicolon argument separators.
Reproducible examples
| Formula | Expected result |
|---|---|
=DAY(DATE(2025;1;15)) |
15 |
=DAY(DATE(2026;1;31)) |
31 |
=DAY(DATE(2024;2;29)) |
29 |
=DAY(DATE(2026;3;0)) |
28 |
=DAY(DATE(2026;1;31)+1) |
1 |
=DAY(DATE(2026;10;15)+TIME(23;30;0)) |
15 |
The first formula preserves the original example and result. Its historical comparable LibreOffice 25.2 check was not an OpenOffice test. New calendar and time results are independently checked reference expectations, not captured native cells. Calendar dates use ISO notation and clock results use HH:MM:SS to avoid ambiguous display conventions.
Practical worksheet: separate day labels from elapsed days
Enter =DATE(2026;1;30), =DATE(2026;1;31) and =DATE(2026;2;1) in A2:A4. In B2 enter =DAY(A2) and fill down. Results are 30, 31 and 1. In C2 enter =A2-$A$2 and fill down. Elapsed-day offsets are 0, 1 and 2.
The day label wraps at the month boundary while elapsed time continues increasing. Therefore B4-B3 is -30, whereas A4-A3 is 1. Use complete dates for chronological differences, not the extracted component values.
Advanced applications
Find the length of a month. =DAY(DATE(YEAR(A2);MONTH(A2)+1;0)) gives the last day number of A2’s month. For February 2024 it is 29; for February 2026 it is 28. For April 2026 it is 30. This uses the calendar rather than a fixed table that might miss leap years.
Compute remaining days explicitly. For a numeric date-only A2, =DATE(YEAR(A2);MONTH(A2)+1;0)-A2 counts days after A2 through month end. January 15, 2026 gives 16. If counting January 15 itself as an included day, add 1 to get 17. A date-time with hours would make the raw difference fractional, so normalize the date portion first when calendar-day counting is intended.
Reconstruct a date for a control. For a date-only input, =DATE(YEAR(A2);MONTH(A2);DAY(A2)) reproduces the calendar date. For a date-time it discards the time. This is useful only when that loss is deliberate and documented.
Errors, edge cases and troubleshooting
DAY and WEEKDAY answer different questions. The day number 15 says nothing about whether the date is a Monday or Friday. Likewise, DAY does not identify the day of a year or a workday index. Choose a function that matches the intended unit.
Formatting the returned integer as a date can hide its meaning. Keep extracted components in numeric format and full date values in a date format. A text value resembling a date can behave differently across locales; these examples avoid that uncertainty by using DATE expressions.
Do not compare only day numbers when sorting events from multiple months. The first of next month is chronologically later than the thirty-first of the current month despite its smaller component. Blank/text coercion, extreme serial values and historical date-system differences are not certified by the independent modern-date checks. Preserve the original date column so any derived field can be recalculated and audited.
Date tip: Dates are internally numeric values, while date formatting controls their appearance. Compare actual dates, not text that merely resembles dates.
Related functions
Documentation and verification
See the Apache OpenOffice DAY reference, 4.1.16 function resources and versioned date/time interpreter. Official source snapshots were retrieved October 13, 2026 and re-read for this guide. The calculations use an independent calendar and exact rational day-fraction model; no fresh native/headless application or GUI execution is claimed. First introduction and final functioning version remain unknown, separate from documented 4.1.16 support.