Formatting a date

brooken

New Member
Joined
Sep 5, 2002
Messages
2
I import data from an AS400, the AS400 uses a date format like 1020401 which equals 2002-04-01 (there way around the Y2K was to go from 99 to 100 instead of 00). How can i get excel to format this into a date that shows dd/mm/yy? Any help would be appreciated.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
Assuming your date is 1st April (not 4th January) and is in cell A1:

=DATE(LEFT(A1,3)+1900,MID(A1,4,2),RIGHT(A1,2))

It will deal with 0990401 but not 990401 though. You could test the length of the string in that case.
 

e_loveall

New Member
Joined
Aug 29, 2002
Messages
35
I use an AS400 system and drop information into Excel all the time. You can also highlight the column with the date (1020731)go to Data, Text to Columns, click Fixed Width, click next, parcel the data so the first 1 is separated from the rest of the date (1, 020731), click next, do not import the 1, and then format the rest of the date yy/mm/dd.

Usually, we do this when we are importing the data into Excel.
 

Watch MrExcel Video

Forum statistics

Threads
1,130,340
Messages
5,641,576
Members
417,223
Latest member
jelena_

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
Top