#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 244
Default Date format

Hi! I have a program that exports data to Excel. The problem is that the
dates are in a format that is not recoginzed by Excel as dates. They look
like: 1997-maj-08, 1997-sep-24, 2005-jan-10 and so on. Is there any way to
covert these dates into normal Excel dates? If you know of a solution in VBA
instead of a worksheet function that would fine too! Thanks alot!


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,646
Default Date format

First make sure that month names appearing in exported dates (maj, sep, jan)
match short month names in your Excel national language version! If yes, then
this formula will do the job:
=DATE(LEFT(A1,4),MONTH(DATEVALUE(MID(A1,6,6))),RIG HT(A1,2))
If not then you have to replace month names like this (it's an example for
Hungarian language version: maj is replaced by máj, sep is replaced by sze)
=DATEVALUE(MID(SUBSTITUTE(SUBSTITUTE(A1,"maj","má j"),"sep","sze"),6,6))

Regards,
Stefi


Arne Hegefors ezt *rta:

Hi! I have a program that exports data to Excel. The problem is that the
dates are in a format that is not recoginzed by Excel as dates. They look
like: 1997-maj-08, 1997-sep-24, 2005-jan-10 and so on. Is there any way to
covert these dates into normal Excel dates? If you know of a solution in VBA
instead of a worksheet function that would fine too! Thanks alot!


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
Convert European Date format to American Format Albert Excel Discussion (Misc queries) 3 August 21st 07 10:02 PM
Convert date from text format to date format Anita Excel Discussion (Misc queries) 3 June 4th 07 11:57 AM
Convert date + time text format to date format Paul Ho Excel Worksheet Functions 2 May 22nd 07 05:47 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
Excel 2000 date format cannot be set to Australian date format Brian Jones Excel Discussion (Misc queries) 1 March 30th 05 06:03 AM


All times are GMT +1. The time now is 12:07 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"