How to Get the Year from a Date in Excel
Pull the year out of a date with YEAR, work out asset age in calendar years, and total spending for one year.
You will learn to
- Extract the year from a date
- Calculate an age in calendar years
- Total values for a chosen year
How it works
YEAR(date) returns the four-digit year of a date as a plain number, for example =YEAR(B2) gives 2019 for 3/14/2019. Because the result is a number, you can subtract it from a report year or compare it with another year.
To total amounts for one year without a helper column, compare YEAR of the whole date range to the year you want inside SUMPRODUCT: =SUMPRODUCT((YEAR(B2:B7)=H2)*C2:C7).
=YEAR(B2)