Date & Time

YEAR Formula

YEAR extracts the year as a four-digit number from a date value. It is used for grouping data by year, calculating age, filtering records to a specific year, or breaking dates into components for reporting. YEAR works on any valid date value or serial number.

Syntax

YEAR(serial_number)
ParameterDescription
serial_number Parameter of the YEAR function.
Try YEAR in Viztab — free, no signup

Examples

Extract year from a date

Formula
=YEAR(A2)
Returns: 2024 — the year portion of the date in A2

Group by year for pivot-like analysis

Formula
=SUMIF(YEAR(A2:A100), 2024, B2:B100)
Note: This pattern is conceptual — use a helper column with =YEAR(A2) then SUMIF on that column

Calculate years between two dates

Formula
=YEAR(B2)-YEAR(A2)
Returns: 3 — the difference in years (approximate; use DATEDIF for exact age)

Common Errors

#VALUE!

The cell contains text that looks like a date but is not a real date value. Convert it with DATEVALUE() first.

Tips

YEAR on TODAY

=YEAR(TODAY()) returns the current year as a number, useful for dynamic copyright notices or fiscal year calculations.

Fiscal year

For fiscal years starting in July: =IF(MONTH(A1)>=7, YEAR(A1)+1, YEAR(A1)) assigns the fiscal year.

Works on serial numbers

YEAR(1) returns 1900 and YEAR(45000) returns 2023. Dates are stored as serial numbers counting from Jan 1, 1900.

Try YEAR in Viztab

Import your data and use YEAR with 370+ other formulas. No signup required.

Open Viztab

Related Formulas