The YEAR function
The year of a date, to group or filter. MONTH and DAY do the same for the month and the day.
Syntax
=YEAR(serial_number)
In a French Excel: =ANNEE(numéro_de_série).
Arguments
- serial_number: a date, or a cell containing one.
An example
=SUMPRODUCT((YEAR(C2:C500)=2024)*D2:D500)
The total of column D for dates in 2024.
Pitfalls
- A date stored as text: #VALUE!.
- An empty cell returns 1900, the year of Excel's day zero.
Going further
- DATE, to rebuild.
- Automatic pivot table: groups by month, quarter or year, with no formula.
Frequently asked questions
- How do I get the month name?
=TEXT(A2,"mmmm")returns "March" in an English Excel.