Extract date in mm/dd/yyy

kumara_faith

Well-known Member
Joined
Aug 19, 2006
Messages
922
Office Version
  1. 365
Hi,

I have a list of employee numbers in the following format:

770205145598

The first two numbers are the year, second two digits are the month and the next two digits are the day. So, in this case the employees' date of birth is February 5 1977. Is there a way to extract the date of birth in mm/dd/yyyy format ? Thank you in advance.
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
And you are saying that this formula (posted earlier by Rich and modified by Alex) does not work for you????

=DATE(LEFT(A1,2),MID(A1,3,2),MID(A1, 5,2))

It should give you a real date but showing in your native format (dd/mm/yyyy) which you can change using Cell Format to display it in whatever way you want. Are you telling us it gives you a #VALUE! error instead?
 
Upvote 0
The formula @Alex Blakenburg posted works fine for me for your sample number and my computer is set up as dd/mm/yyyy (I have wrapped it in a TEXT function just to make it display as mm/dd/yyyy).

What you you get with the formula =CODE(A1).

Can you also click the
1627829540674.png
in the XL2BB sample below and paste in cell A1 in a new sheet (format the cell as Text before doing the paste) and report back what you get (please note that cell A1 is a number formatted as text in my actual sheet, not as it appears below)

Book1
AB
179112409515711/24/1979
Sheet1
Cell Formulas
RangeFormula
B1B1=TEXT(DATE( LEFT(A1,2), MID(A1,3,2), MID(A1, 5,2)),"mm/dd/yyyy")
 
Upvote 0
Hi Rick and MARK858,

My sincere apologies. I figured out what was meant by turning it into text format and now it worked. Thank you again for your valuable time and patience.
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,279
Members
449,075
Latest member
staticfluids

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