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

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
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,932
Messages
6,122,332
Members
449,077
Latest member
jmsotelo

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