In Excel, how can you format for 4 digit years (MM/DD/YYYY)?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm pulling in an unformatted 8-digit date field from an AS400 into an excel
spreadsheet. I would like to be able to format it in MM/DD/YYYY format in the
spreadsheet, but get weird numbers when I do so. I don't see anything in the
standard date formatting section and have created a Custom Format as
' / / ', but this will not work either.
 
Chucky,
You'll need to use the date(year,month,day) function to convert to an excel
date. You can break down your data from the AS400 by using string functions.
Say the date is 02042005 in cell C7, then the formula would be
=DATE(RIGHT(C7,4),LEFT(C7,2),MID(C7,3,2)). You can then format it as you
wish.
Gary
 
Chucky

Assuming your data is coming in like 20051231 or similar.

Try Data>Text to Columns>Next>NextColumn Data Format>Date and pick the
appropriate format then Finish.

You will have to then format the cells to your MM/DD/YYYY format.


Gord Dibben Excel MVP
 
Select the import, do data>text to columns, click next twice, select Date
under columns data format and from dropdown select the imported date format
so if it can look like 10122004 (10/12/2004) then select MDY and click finish


Regards,

Peo Sjoblom
 
Good tip Peo, I learned something new.
Gary

Peo Sjoblom said:
Select the import, do data>text to columns, click next twice, select Date
under columns data format and from dropdown select the imported date format
so if it can look like 10122004 (10/12/2004) then select MDY and click finish


Regards,

Peo Sjoblom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top