The Excel YEAR function returns the year component of a date as a 4-digit number. You can use the YEAR function to extract a year number from a date into a cell or to extract and feed a year value into another formula, like the DATE function.
Examples:
The YEAR function extracts the year from a given date as a 4-digit number. =YEAR("23-Aug-2012")
// returns 2012 =YEAR("11-May-2019")
// returns 2019
You can use the YEAR function to extract a month number from a date into a cell, or to feed a month number into another function like the DATE function: =DATE(YEAR(A1),1,1)
// first of same year
How to get year from date time:
-With Now function: =YEAR(NOW())
// current year eg. 2022 => results in 2022
-With the specified cell (B46): =YEAR(B46)
// result 2020
B46 contains the value 05-08-2020 09:04
If this is unable to pick the value from the cell, change the data type of the data column as text.
-With specified value as string : =YEAR("05-08-2019 08:09")
// result 2019
We have many more articles related to Now, Date, WeekNumber, workday and others.