Syntax
| Parameter | Description |
|---|---|
| serial_number | Parameter of the YEAR function. |
Examples
Extract year from a date
=YEAR(A2)
Group by year for pivot-like analysis
=SUMIF(YEAR(A2:A100), 2024, B2:B100)
Calculate years between two dates
=YEAR(B2)-YEAR(A2)
Common Errors
The cell contains text that looks like a date but is not a real date value. Convert it with DATEVALUE() first.
Tips
=YEAR(TODAY()) returns the current year as a number, useful for dynamic copyright notices or fiscal year calculations.
For fiscal years starting in July: =IF(MONTH(A1)>=7, YEAR(A1)+1, YEAR(A1)) assigns the fiscal year.
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