Formula to return a code as a year (eg 1998)

Kopi$star

New Member
Joined
Jul 6, 2012
Messages
19
I have a code in which the first 2 digits represent the year. I.E. 8040121011 would represent 1980. I understand that the function left(a1,2) would return 80 for 1980. However, I need to return 1980. Is there a way in which I can use another formula as well to combine with the left function and get 1980?

Thanks for your help.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Hi,

Try the following formula in the column after your =left(a1,2)....

=if(c1>12,19,20)

Then in column E...

=c1&d1

Cheers,

Dave.
 
Upvote 0
Try

=YEAR("1/1/"&LEFT(A1,2))


Note, the cutoff is 30 between 1900 and 2000

00 - 29 = 2000 - 2029
30 - 99 = 1930 - 1999
 
Upvote 0

Forum statistics

Threads
1,214,926
Messages
6,122,306
Members
449,079
Latest member
juggernaut24

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top