Contact

DAYSINMONTH Function (OpenOffice Calc)

Date & Time Intermediate OpenOffice Calc

Find a month’s length with DAYSINMONTH in Apache OpenOffice Calc. Use date inputs, leap-year rules and end-of-month worksheet examples.

Verification status: Eight ordinary reference formulas were recalculated in Apache OpenOffice 4.1.16 on Linux x86-64, Build 9816, through generated native ODF and GUI hard recalculation. Saved identities and results were checked. The registered ORG.OPENOFFICE storage name was used; English-name availability is source-checked. How formula examples are checked

Quick answer: =DAYSINMONTH(DATE(2024;2;15)) returned 29 in the tested Apache OpenOffice 4.1.16 build.

Availability and version history

  • Introduced: First release not established; documented by OpenOffice.org 3.3.
  • Supported in: Apache OpenOffice 4.1.16; this is a verified release, not a final supported version.
  • Scope: Desktop Calc, English function names and semicolon-separated formulas.
  • Checked: October 14, 2026. Eight ordinary reference formulas were recalculated from generated ODF in 4.1.16 on Linux x86-64, Build 9816. Source and independent calendar arithmetic were checked.

What DAYSINMONTH returns

DAYSINMONTH returns the number of calendar days in the month containing Date: 28, 29, 30 or 31. It belongs to the date add-in family. The argument is a date serial, not a month number, year number or number of elapsed days. Release implementation.

Syntax and arguments

DAYSINMONTH(Date)
  • Date: one required date value, preferably a date cell or DATE(year;month;day).
  • The implementation receives an integer date serial and uses the document’s configured null date. Supply date-only values deliberately; fractional conversion was not part of this native fixture.

Eight reproducible examples

The native column contains saved 4.1.16 results; independent references use exact date arithmetic or rational fractions. Numerical values are shown to twelve decimal places where needed. Enter the DATE expressions directly rather than substituting locale-dependent text.

The generated ODF uses ORG.OPENOFFICE.DAYSINMONTH, mapped to the English worksheet name DAYSINMONTH by the release function map. The saved operation was verified after recalculation. This establishes the ODF-format path rather than manual English-name entry.

Formula Native 4.1.16 result Independent reference
=DAYSINMONTH(DATE(2024;2;15)) 29 29
=DAYSINMONTH(DATE(2023;2;15)) 28 28
=DAYSINMONTH(DATE(2024;4;30)) 30 30
=DAYSINMONTH(DATE(2024;1;1)) 31 31
=DAYSINMONTH(DATE(2000;2;1)) 29 29
=DAYSINMONTH(DATE(1900;2;1)) 28 28
=DAYSINMONTH(DATE(2100;2;1)) 28 28
=DAYSINMONTH(DATE(2024;12;31)) 31 31

Practical worksheet

If A2 contains =DATE(2024;2;15), =DAYSINMONTH(A2) gives 29. Replacing the year with 2023 gives 28. For a monthly allocation whose rule is an equal amount per calendar day, a monthly amount of 290 divided by 29 gives 10 per day. Whether that allocation rule is appropriate is a separate model decision.

The day within the month does not change its length. April 1 and April 30, 2024 both belong to a 30-day month. The example table uses explicit DATE formulas so the intended month is visible.

Advanced interpretation and checks

The calendar rule is Gregorian: years divisible by 4 are leap years except century years not divisible by 400. Consequently February 2000 has 29 days, while February 1900 and February 2100 each have 28. Do not use a simple “divisible by four” rule for all years.

With a valid date in A2, a transparent month-end construction is =DATE(YEAR(A2);MONTH(A2);DAYSINMONTH(A2)). For February 15, 2024 it represents February 29. Another useful identity is DAYSINMONTH(A2)=DAY(EOMONTH(A2;0)); the date and serial meanings should agree. These explanatory identities were checked independently, beyond the eight listed native calls.

Boundaries and troubleshooting

Entering DAYSINMONTH(2) asks about date serial 2 in the active date system; it does not mean February. Likewise, 2024 is a serial when passed directly. Construct the intended date explicitly.

The tested ODF stored this add-in under its registered ORG.OPENOFFICE name. Its English worksheet identity was checked in the release registry. No manual-entry, other-locale or invalid-input execution is claimed. Preserve date values when importing text or copying between workbooks with different date systems.

Official evidence and checking scope

The generated ODF produced the informational load warning “Not all attributes could be read.” The sheet was hard-recalculated and saved separately. All eight ordinary function identities and results were reconciled; a stale SUM cache changed from 999999 to 3 and an uncached SUM returned 7. This establishes the stated examples, not every workbook style or invalid input. Other explanatory identities are independent calculations. The authoring-tool XLSX was not executed in OpenOffice, and its preview values are not the native results reported here.