Contact

DAYSINYEAR Function (OpenOffice Calc)

Date & Time Intermediate OpenOffice Calc

Use DAYSINYEAR in Apache OpenOffice Calc to return 365 or 366 from a date, with leap-century examples and clear year-fraction limits.

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: =DAYSINYEAR(DATE(2024;2;15)) returned 366 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 DAYSINYEAR returns

DAYSINYEAR returns 365 or 366 for the calendar year containing Date. It is a calendar property, rather than the number of days remaining in the year or a universal financial day-count denominator. Release implementation.

Syntax and arguments

DAYSINYEAR(Date)
  • Date: one required date serial or date cell. Use DATE(year;month;day) to construct a date reliably.
  • The argument is not a bare year number. The release’s date add-in receives an integer serial relative to the document date system.

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.DAYSINYEAR, mapped to the English worksheet name DAYSINYEAR 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
=DAYSINYEAR(DATE(2024;2;15)) 366 366
=DAYSINYEAR(DATE(2023;2;15)) 365 365
=DAYSINYEAR(DATE(2000;1;1)) 366 366
=DAYSINYEAR(DATE(1900;1;1)) 365 365
=DAYSINYEAR(DATE(2100;1;1)) 365 365
=DAYSINYEAR(DATE(2020;12;31)) 366 366
=DAYSINYEAR(DATE(2025;1;1)) 365 365
=DAYSINYEAR(DATE(2024;12;31)) 366 366

Practical worksheet

If A2 is =DATE(2024;2;15), =DAYSINYEAR(A2) gives 366. For the corresponding 2023 date the result is 365. A calendar-year daily average of a measured annual total can use this denominator when the total genuinely covers every day of that calendar year.

Do not use the function to decide how many days a partial interval contains. March 1 to April 1 requires subtraction of the actual endpoint dates; DAYSINYEAR still reports the length of the entire containing year.

Advanced interpretation and checks

For a Gregorian calendar year y, DATE(y+1;1;1)-DATE(y;1;1) equals its number of days. For y=2024 this is 366; for y=2025 it is 365. The independent calendar arithmetic confirms all eight examples.

Century handling is important: 1900 and 2100 have 365 days, while 2000 has 366. Leap status depends on the year, so moving the input from January to December within the same year does not change the answer. DAYSINYEAR(A2)=365+ISLEAPYEAR(A2) expresses the relationship for valid date values.

Boundaries and troubleshooting

DAYSINYEAR(2024) interprets 2024 as a date serial. Use DAYSINYEAR(DATE(2024;1;1)) to ask about the year 2024. Avoid locale-sensitive text dates and check date-system settings when moving bare serials.

A financial convention may use 360, a fixed 365, or a more specific actual/actual rule. This calendar result does not choose that convention for you. Only the eight stated date calls were executed; text parsing, fractional serials and invalid dates remain outside the native scope.

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.