Home > Back-end >  Excel - RIGHT formula not working as expected
Excel - RIGHT formula not working as expected

Time:02-01

RIGHT formula

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)

CodePudding user response:

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.

CodePudding user response:

Try =YEAR(H2) instead? RIGHT formula does not work ideally for dates.

  •  Tags:  
  • Related