Get information from the middle characters of data automatically

ybr_15

Board Regular
Joined
May 24, 2016
Messages
204
Office Version
  1. 2019
  2. 2013
Platform
  1. Windows
Dear members, I have random data (student number) like this: A120140045, A120160042; A120090122; A120120001, ...etc. Three characters from middle data (character 5th to 7th) indicate the year registration. So, based on the data, 140 is 2014; 150 is 2015; 090 is 2009; 120 is 2012; ...etc. I want get this "year" information from the data with easiest formula without having to add next year in formula (my data start from year 2000). To my knowledge, I can use IF and MID function but I don't know how to combine the function to get suitable formula automatically.

Here example my old formula that I use (still manually and long):
Code:
=IF(MID(A1;5;3)="000";2000;IF(MID(A1;5;3)="010";2001;...etc

Thank you...
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
How about:
Code:
="20" & MID(A1,5,2)
 
Upvote 0

Forum statistics

Threads
1,213,527
Messages
6,114,140
Members
448,551
Latest member
Sienna de Souza

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