In this data set, the employees' hire dates are in month/day/year format in column D. But what if you needed to know just the year that an employee was hired? The YEAR function makes finding this information easy.
The Employees worksheet already has a column labeled "Year Hired" (column L). The YEAR function can be entered in cell L2 and copied down.
NOTE: It is important to know that Excel stores dates as consecutive integers: January 1, 1900 is assigned the number 1 and each day thereafter is simply consecutive. For example, April 28, 2015, is stored as 42122. That consecutive number is called the serial number. Cell formatting causes that serial number to be displayed as a date. For example, July 6, 2006’s serial number is 38904. The short date format displays it as 7/6/2006. Also, times are stored as decimals: For example, noon on 7/6/20016 is stored as 38904.5. For more information about how Excel handles dates and times, see: https://support.office.com/en-us/article/time-function-9a5aff99-8f7d-4611-845e-747d0b8d5457.
The YEAR function returns the year for any serial number.
The syntax for the YEAR function is as follows:
You can use the named range, Hire_Date, in place of the date.