YEAR Function (OpenOffice Calc)
Learn the YEAR function in Apache OpenOffice Calc: Returns the year of a date value as an integer.
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.
YEAR extracts the calendar year from a numeric spreadsheet date or date-time. It does not count elapsed years and does not parse a year merely because digits appear at the start of text. The inspected callback floors the serial value, adds it to the document’s base date and returns the resulting calendar year.
Syntax and arguments
=YEAR(date_value)
One numeric date value or a reference to one is required. A date-time’s fractional day is excluded by approximate flooring for ordinary modern serial values. The date base comes from the workbook formatter. Use DATE to construct unambiguous controls instead of assuming that a particular raw serial has the same meaning in every workbook. Examples use English function names and semicolon argument separators.
Reproducible examples
| Formula | Expected result |
|---|---|
=YEAR(DATE(2025;1;15)) |
2025 |
=YEAR(DATE(2026;12;31)) |
2026 |
=YEAR(DATE(2027;1;1)) |
2027 |
=YEAR(DATE(2024;2;29)) |
2024 |
=YEAR(DATE(2026;12;31)+TIME(23;30;0)) |
2026 |
=YEAR(DATE(2026;12;31)+1) |
2027 |
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: tag events by calendar year
Enter =DATE(2025;12;31), =DATE(2026;1;1) and =DATE(2026;7;15)+TIME(16;30;0) in A2:A4. In B2 enter =YEAR(A2) and fill down. Results are 2025, 2026 and 2026. The time portion of the third event does not change its year.
In C2 enter =DATE(B2;1;1) and fill down. Expected year-start anchors are January 1, 2025; January 1, 2026; and January 1, 2026. These anchors remain dates, whereas the values in B are simple year numbers. Keep the two meanings distinct when sorting, calculating intervals or joining data.
Advanced applications
Build a calendar-year label, not an age. YEAR(end)-YEAR(start) compares year labels. From December 31, 2025 to January 1, 2026 it gives 1 even though only one day elapsed. Do not use that difference alone as a completed-years or age calculation.
Define a fiscal label explicitly. For a reporting year that starts in July and is named by its ending calendar year, use =YEAR(A2)+IF(MONTH(A2)>=7;1;0). June 30, 2026 maps to 2026 and July 1, 2026 maps to 2027. This convention is a worksheet choice, not something YEAR knows automatically.
Construct year boundaries. =DATE(YEAR(A2)+1;1;1)-DATE(YEAR(A2);1;1) gives 366 for a 2024 input and 365 for 2026. It measures the full calendar year, including February 29 when present, without assuming every year has 365 days.
Errors, edge cases and troubleshooting
YEAR expects a date serial, so supplying the bare number 2026 does not mean the year 2026. It means a date located 2,026 days from the configured base. Construct DATE(2026;1;1) when that calendar year is intended.
A text string that looks like a date may depend on locale-sensitive parsing or remain text. These controls deliberately use DATE, not ambiguous slash-separated literals. The guide does not certify every blank, Boolean, text or out-of-range coercion. Original errors in referenced calculations should be investigated rather than silently replaced with a guessed year.
Calendar-year grouping can be unsuitable for a fiscal period, an academic year or a rolling twelve-month interval. State the required convention separately. The callback reads a local numeric date, not a timestamp with timezone conversion. Events near midnight can require timezone handling before they enter this worksheet. Native locale, historical boundaries and imported date systems remain untested.
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 YEAR 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.