Reputation: 17
I am trying to get the last 4 characters (the year in this case) from one column to be displayed in a new column. As far as I am aware, the formula I am doing is correct but the column isn't displaying the correct values (should be 2016, 2015 etc)
Upvotes: 1
Views: 2220
Reputation: 8375
So first, use right() for each cell:
=right(H2,4)
Then get excel to recognize the result as a number not text (text is left and numbers right formatted in the cell):
=right(H2,4)*1 or =value(right(H2,4))
But, as others have pointed out, dates are represented in Excel with a serial number - try changing the formatting and you will see.
Upvotes: 0
Reputation: 543
Try =YEAR(H2)
instead? RIGHT
formula does not work ideally for dates.
Upvotes: 2