Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 205
Default change date format

I have a database that has a date format of yyymmdd. I need this to be
mmddyyyy. How can I change this?

--
linda
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default change date format

Strange to have a 3-digit year.

If A1 contains:
0081225

In cell B1 enter:
=DATE(2000+LEFT(A1,3),MID(A1,4,2),RIGHT(A1,2))
and format Custom as mmddyyyy to display
12252008

--
Gary''s Student - gsnu200772


"linda" wrote:

I have a database that has a date format of yyymmdd. I need this to be
mmddyyyy. How can I change this?

--
linda

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default change date format

Assuming the 3-digit database year is correct (and not a mistyping of yyyy),
your formula will only work if the year value is in this millennium (for
example, it will fail for 997 as the first 3-digits). Here is a modification
to your formula that will work for the any between 1/1/1900 and
12/32/2099...

=DATE((1+(LEFT(A1)="0"))&LEFT(A1,3),MID(A1,4,2),RI GHT(A1,2))

Also, here is an slightly shorter formula which also works within the same
range of years....

=--TEXT((1+(LEFT(A1)="0"))&A1,"0000-00-00")

Again, both of the above formulas assume the OP's database date really only
has a 3-digit year. If it turns out that the database date pattern was
mistyped and should have been really been yyyymmdd, then my proposed formula
would be...

=--TEXT(A1,"0000-00-00")

In all case above, your suggestion to use a Custom format to display the
converted date as mmddyyyy still holds.

Rick


"Gary''s Student" wrote in message
...
Strange to have a 3-digit year.

If A1 contains:
0081225

In cell B1 enter:
=DATE(2000+LEFT(A1,3),MID(A1,4,2),RIGHT(A1,2))
and format Custom as mmddyyyy to display
12252008

--
Gary''s Student - gsnu200772


"linda" wrote:

I have a database that has a date format of yyymmdd. I need this to be
mmddyyyy. How can I change this?

--
linda


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change satellite julian date format YYYYDDDHHMMSS to excel date ti putley Excel Discussion (Misc queries) 1 January 11th 08 06:12 PM
Use date modified to change format & create filter to track change PAR Excel Worksheet Functions 0 November 15th 06 09:17 PM
Can I change a date with no format (20051111) to date format? Rose New Users to Excel 2 November 11th 05 09:03 PM
Change general format to US date format woodlot4 Excel Discussion (Misc queries) 3 October 11th 05 12:29 AM
how do I format cells to change date and time to just date bondam Excel Discussion (Misc queries) 3 July 3rd 05 01:10 PM


All times are GMT +1. The time now is 09:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"